10-07-2024, 09:20 AM
(10-06-2024, 11:23 PM)TheOldPresbyope Wrote: @bikerman
I read your original post to mean you will collect all your music files on a central NAS and want to mirror those files on your (portable) moOde player.
I would expect you'd want to run the mirroring process from the moOde player. Notice that the script posted by @steve4star is the opposite. It's fine but the way it is written it would copy files from the computer on which it's executing to a target moOde player. As well, it is talking directly to the target system's file system.
I envisioned the following instead:
Since you're storing the files on a NAS, I would not assume it is capable of running rsync (although it might very well be). Instead, I'd take advantage of the NAS offering the music directory as a SMB share (NFS would work too but I don't use it). On the moOde player of interest, I'd mount that SMB share to some temporary directory, then use rsync to copy the files from that directory to my local music directory. When done I'd unmount the SMB share. That could be scripted along with the moOde command to update its library. There remains the question of when to trigger the script.
Notes-
1. rsync is already present in moOde (at least it is in 9.1.2).
2. rsync is like a Swiss Army knife. It has lots of options. If you're not familiar with it I suggest you look on the InterWeb for introductory articles about it.
Just my 2 cents worth.
Regards,
Kent
Thanks @TheOldPresbyope and yes you are correct ,I do want to initiate the syncing process from the MoodePi as opposed to centrally from the NAS. This will also account for the times the MoodePi is offline; it can rsync when it comes back on. My NAS (Synology) does offer rsync thankfully and have used it for other things in the past.
My current thinking is to use crontab to schedule a job ro run rsync which i plan to configure to sync changed files.
what do you think?