this post was submitted on 14 Aug 2026
7 points (100.0% liked)

Linux Questions

4116 readers
8 users here now

Linux questions Rules (in addition of the Lemmy.zip rules)

Tips for giving and receiving help

Any rule violations will result in disciplinary actions

founded 3 years ago
MODERATORS
 

Hey all!

Let me go stratight to the point:

I have an audio player in which I want to clone my ~/Music directory when I connect it to my computer. The only relevant thing about it is that it's a barebones filesystem and I cannot run cool stuff like Syncthing on the player (otherwise this question would already have a solution). Right now, my solution is that I connect the player to the computer and manually copy file to and delete files in the player. As you may have guessed, this is an error prone process. In order to solve that, I want to run a single command that clones ~/Music (src) into /path/to/player/Music (dst).

My requirements are:

  • All new files in src MUST be copied into dst.
  • All files no longer present in src MUST be deleted from dst.
  • All files present in both src and dst that have more recent modifications in src MUST be copied and overwritten into dst.

As you can see, my player's filesystem is a strict replica of my main computer's. Now, I know I can write a Python script in an afternoon to do just that, but I want to know if there are any good tools first to do this. I searched the web in hope that rsync would help me here, but the only answers I can find are for buffier cp. It may be that I have a vocabulary problem and I'm not searching for the correct terms.

I'd love to read your ideas! A note about LLMs: I'm not interested at all in any comments about how llm-of-the-week coded this in a moment, I asked fake-chat and here's what it said or whatever. If you are not a human that can be bothered to write an answer, I won't be bothered to read it.

Thank you!

you are viewing a single comment's thread
view the rest of the comments
[–] groctel@lemmy.world 1 points 2 days ago (1 children)

I don't save FLAC files, as I don't have that much space (my library is 82GB big with 17629 tracks atm). What I do is that I have a script I wrote to convert all the files to Opus. I still have some old mp3s laying around that I convert or find better sources over time.

As for rsync command, it's taken far longer than I would like to sync all the files. I've gotten an idea about caching the filesystem status for later uses to speed up the process, so I may end up writing a script after all!

[–] schipelblorp@sh.itjust.works 1 points 2 days ago (1 children)

You know more than I do, I think, but how would writing the script speed up the file transfer?

The first time you use rsync, it's going to take a long ass time because you are copying EVERY file. But after the first sync, you're just copying changes, so it'll take much less time.

I use fre:ac to convert things pretty trivially, but I suspect you may enjoy writing scripts, to which I say: enjoy!

[–] groctel@lemmy.world 2 points 13 hours ago

I added some context here. The thing is that it still took ages because stating every file is still very slow in my target player, so if I cache the status I can automatically create a script that just performs the required operations and run that.

And yes, I do enjoy writing small utilities :p Thanks!