Thank you for your donation!


Cloudsmith graciously provides open-source package management and distribution for our project.


Idea: Question: RSYNC on Moodeaudio RP to keep music files in Sync
#1
Hi All.
I was wondering if it would be a good idea to use rsync to keep my music on my various Moodeaudio players in sync from a central location? Any foreseeable problems, pros and cons? 

Scenario:
I am about to start the task of converting all my CD's (over 500) to flac. The flac files will be stored on a NAS. I have a Pi 5 with nvme attached. In addition, when i am mobile, i take this pi with me. I am aware I can copy these manually using smb shares, but i thinking if rsync is robust enough it could make for a automated solution.

Thanks in advance

Oh, i did search for 'music syncing' 'rsync' before posting, so apologies if this ais a repeat question
Reply
#2
(10-06-2024, 10:32 AM)bikerman Wrote: Hi All.
I was wondering if it would be a good idea to use rsync to keep my music on my various Moodeaudio players in sync from a central location? Any foreseeable problems, pros and cons? 

Scenario:
I am about to start the task of converting all my CD's (over 500) to flac. The flac files will be stored on a NAS. I have a Pi 5 with nvme attached. In addition, when i am mobile, i take this pi with me. I am aware I can copy these manually using smb shares, but i thinking if rsync is robust enough it could make for a automated solution.

Thanks in advance

Oh, i did search for 'music syncing' 'rsync' before posting, so apologies if this ais a repeat question

moOde is built on a Linux distro and rsync should work just fine. Try it.

I don't see any reason to build rsync support into the moOde WebUI though.

Regards,
Kent
Reply
#3
I'm not that experienced with rsync, but you could also think about syncthing for this purpose.

https://syncthing.net/
Reply
#4
(10-06-2024, 10:32 AM)bikerman Wrote: Hi All.
I was wondering if it would be a good idea to use rsync to keep my music on my various Moodeaudio players in sync from a central location? Any foreseeable problems, pros and cons?

I use the following script to sync and then ask Moode to update the library...

You will need to change the file paths for your environment, I think yo also have to install your ssh key to stop it prompting for password every time.
Code:
rsync -axz --zc=zstd --update --exclude 'albumart_backup' --progress --stats ~/Music/flac/ moode@azure-640h.local:/media/WD\ 240\ Gb/flac/ && curl "http://azure-640h.local/command/?cmd=upd_library"
Reply
#5
'A problem aired is a problem halved',  in this case a problem solved Smile Thanks @steve4star for the script

Thanks @TheOldPresbyope and @Falco 

Syncthing seems quite cool, but i think it will require a client install on the Moodeaudio install? Whatever the case, it seems  have  soluion with rsync
Reply
#6
(10-06-2024, 03:57 PM)bikerman Wrote: 'A problem aired is a problem halved',  in this case a problem solved Smile Thanks @steve4star for the script

Thanks @TheOldPresbyope and @Falco 

Syncthing seems quite cool, but i think it will require a client install on the Moodeaudio install? Whatever the case, it seems  have  soluion with rsync

Yes indeed, you will have to install syncthing on the underlying os. But it should be available for any os actually.
Reply
#7
@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
Reply
#8
(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?
Reply
#9
Hello bikerman,

why do you think it is better to sync the data to your players, instead of using the share on your NAS directly?
I use a device with USB 2.0 to share a M.2 SSD in the internal network, and everything is fast, even the update of the library is fast.
Your device has USB 3.0, so there should be no issue at all..

Simply create a NAS-Share under "configure->Library".
Afterwards start a library update, finished.
If you have stored new music on the nas, simply run the "update library" feature in Moode again.

Greets Tom.
Reply
#10
(10-07-2024, 09:42 AM)muddiver Wrote: Hello bikerman,

why do you think it is better to sync the data to your players, instead of using the share on your NAS directly?
I use a device with USB 2.0 to share a M.2 SSD in the internal network, and everything is fast, even the update of the library is fast.
Your device has USB 3.0, so there should be no issue at all..

Simply create a NAS-Share under "configure->Library".
Afterwards start a library update, finished.
If you have stored new music on the nas, simply run the "update library" feature in Moode again.

Greets Tom.

Hi @muddiver
Two scenarios actually (1) when mobile and out of town, I prefer to have music on my MoodePi. On planes, in hotels or locations where network connectivity isn't availbe. (2) In my home. wifi signals in one of the rooms where I listen is not great. I get dropouts on  5Ghz  and unreliable (choppy audio) on  2.4Ghz so cannot reliabe stream. Local storage simply frees me from these concerns.

I am however open to other options I may not have thought about

Thanks
Reply


Forum Jump: