9

I want to use rsync to backup a directory from a local location to a remote location, and store changed files in another remote location. I did use:

rsync -rcvhL --progress --backup \
  --backup-dir=user@url.com:/home/user/Changes/`date +%Y.%m.%d` . \
  user@url.com:/home/user/Files/

The --backup-dir stays empty, while it should be filled. Is it possible what I'm trying to accomplish is not possible or am I doing something wrong?

6

--backup-dir=DIR

In combination with the --backup option, this tells rsync to store all backups in the specified directory on the receiving side. This can be used for incremental backups. You can additionally specify a backup suffix using the --suffix option (otherwise the files backed up in the specified directory will keep their original filenames).

Keyword, receiving side. So, the correct syntax is --backup-dir=/path/on/destination/server Hope that answers your question.

When I saw your syntax I got a little bit excited for a second, because I thought that it became capable of redirecting the backed up files to another server.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.