s3ql_backup.sh rsync multiple directories

36 views
Skip to first unread message

Travis Lawrie

unread,
Nov 23, 2010, 11:43:58 AM11/23/10
to s3ql
I tried modifying s3ql_backup.sh to rsync more than one directory.

When I run the script, it doesn't seem to call the second rsync I
added. Any ideas? Code below:

# ..and update the copy
rsync -aHAXx --delete-during --delete-excluded --partial -v \
--exclude /.cache/ \
--exclude /.s3ql/ \
--exclude /.thumbnails/ \
--exclude /tmp/ \
--exclude /.VirtualBox/ \
--exclude /.local/share/Trash/ \
--exclude /.wine/ \
--exclude /Downloads/ \
--exclude /Music/ \
--exclude /Videos/ \
--exclude /Pictures/ \
"/home/travis/" "./$new_backup/"

rsync -aHAXx --delete-during --delete-excluded --partial -v \
"/home/media/music/tagged/" "./$new_backup/"

Thanks

Nikolaus Rath

unread,
Nov 23, 2010, 2:06:13 PM11/23/10
to s3...@googlegroups.com

There probably is a "set -e" at the beginning of the script. This causes
the script to abort as soon as any command fails. So if the first rsync
call encounters errors, the second will not be called. Other than that,
there is no reason why the second call should not be executed. Try
adding the -v argument to both calls to get more information.

Note that your second rsync invocation is going to delete everything
that the first call transferred. You are telling rsync to make the
contents of $new_backup identical to /home/media/music/tagged. This
means that anything copied from /home/travis has to be deleted.

To fix this, you can backup the two directories into e.g.
$new_backup/home and $new_backup/media respectively.


HTH,

-Nikolaus

--
»Time flies like an arrow, fruit flies like a Banana.«

PGP fingerprint: 5B93 61F8 4EA2 E279 ABF6 02CF A9AD B7F8 AE4E 425C

--
Sent from my Android phone with K-9 Mail. Please excuse my brevity.

Travis Lawrie

unread,
Nov 23, 2010, 4:02:26 PM11/23/10
to s3ql
Oh! That explains it. rsync was giving me errors because it didn't
have permissions to some files. I was just ignoring it not knowing
that it was causing problems.

Also thanks for the tip about rsync deleting existing files :)
Reply all
Reply to author
Forward
0 new messages