#StackBounty: #rsync rsync: Don't create destination directory

Bounty: 50

I want to rsync my root directory to an external hard disk mounted under /media/guettli/backup1t/.

rsync -xavi --delete --delete-excluded 
  --exclude '...' 
  /  /media/guettli/backup1t/

Something went wrong with the mounting and rsync happily created /media/guettli/backup1t/ in the root directory and rsynced copied files there and not onto the external hard drive.

I would like to avoid this.

I could do it with a shell script which checks that /media/guettli/backup1t/ exists before starting rsync, but I would prefer an option to rsync.

How can I tell rsync to not start the sync, if the destination does not exist?


Get this bounty!!!

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.