Skip navigation

Being you, reader, a wise person you are going to keep a copy of your entire music library in some external storage device.
Here is a simple example on how to keep your external mirror synchronised with your music library:

SOURCE="/my/library/"
DEST="/media/myDevice/my/mirror/library/"
rsync -ruv --progress --size-only "$SOURCE" "$DEST" | tee sync.log

-r : recursively sync the subfolders;
-u : skip files that are newer on the destination folder (update);
-v : increase verbosity (print the files that are copied to the destination);
–progress : show a progress bar;
–size-only : skip files with same size.

This way, a new music file that you added in SOURCE is copied in DEST if not present, or if newer and of a different size of the corresponding file (song..) in DEST.
For a two-way synchronisation, just repeat the rsync instruction reversing the order of “$SOURCE” and “$DEST”.

[!!!] End up SOURCE and DEST paths with a trailing slash to copy the directory contents (whereas not having the slash would copy that directory).
[i] Rsync is installed on Ubuntu systems by default [https://help.ubuntu.com/community/rsync].

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: