I've been messing with rsync to push my music library (managed by banshee) to my sdcard, which I use for my phone.
This helps me get around the fact that I don't have a good GUI program to sync music back and forth from my phone. While I always hated iTunes, I'll admit, it was great at managing music and other files stored in the program between an external device and the PC. I don't claim that rsync isn't an amazing utility, I know it is, I'm just not as skilled with it as I hoped to be.
Going through the man page a couple of times I came up with the following 2 scripts:
syncToSdCard.sh:
#!/bin/bash
exec > >(tee ~/rsync.out);
exec 2> >(tee ~/rsync.err);
rsync -v -r --delete-delay /home/user/Music/ /media/user/0741-C987/Music/;
updateSdCardOnly.sh
#!/bin/bash
exec > >(tee ~/rsync.out);
exec 2> >(tee ~/rsync.err);
rsync -v -r -u --inplace -m --prune-empty-dirs -e --delete /home/user/Music/ /media/user/0741-C987/Music/;
My goal is to both update the directory on the sdcard with the contents of the directory on my machine, and clean anything that has been moved or removed from the source directory.
The first rsync script (syncToSdCard.sh) does this; however, it takes a long time to run.
The second rsync script, while it contains the delete option only pushes changes from my local machine (new files and updated files) to the sdcard; this script is extremely fast though.
What I'm looking for is someone who can help me merge the 2 together, to get a fast update with deletion of files that no longer exist on the source (pc) as they do on the target (sdcard).
Can someone please help me with this? I'm also open to alternative ways of achieving the same goal if possible; rsync is just the best utility I can think of for this kind of operation.
Thanks.