On Sat, 2009-10-03 at 15:47 -0700, J. Ellis wrote: > I have the following 3 commands which are supposed to run every night > to back up my web server: > > rsync -avve ssh --numeric-ids --delete --ignore-errors > myu...@myisp.com:/usr/home/myuser /Volumes/Downloads > rsync -avve ssh --copy-links --numeric-ids --delete --ignore-errors > myu...@myisp.com:/usr/home/myuser/mail_boxes > /Volumes/Downloads/myuser/mail_boxesBU > rsync -avve ssh --copy-links --numeric-ids --delete --ignore-errors > myu...@myisp.com:/usr/home/myuser/mail_boxes > /Volumes/Downloads/myuser/mail_boxesBU > > The way this works is that there are two symlinks on the server to the > mail_boxes and public_html directories. I didn’t want all the symlinks > within those directories to be followed, so these I backup separately > to mail_boxesBU and public_htmlBU respectively.
There happens to be a trick for "copying a few dirlinks" without copying all of them: use --relative and specify an additional source argument that goes through each symlink with a trailing slash. E.g.: rsync -avve ssh --numeric-ids --delete --ignore-errors -R \ myu...@isp.com:/usr/home/./myuser \ myu...@isp.com:/usr/home/./myuser/mail_boxes/ \ myu...@isp.com:/usr/home/./myuser/public_html/ \ /Volumes/Downloads For more about this, see: http://lists.samba.org/archive/rsync/2006-February/014838.html > Unfortunately, when the first command is run, both are deleted from > the local volume, and then must be completely downloaded from scratch > each night after the deletion, instead of simply being updated. This > doesn’t always work for some reason, and the next morning one or both > of the directories are just gone. > > Is there some way of excluding the mail_boxesBU and public_htmlBU > directories from --delete? If you want to keep your existing approach, yes, you can just use --exclude='/myuser/mail_boxesBU' and --exclude='/myuser/public_htmlBU'. -- Matt -- Please use reply-all for most replies to avoid omitting the mailing list. To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html