I'm trying to use RSYNC to restore a backup. I am trying to restore all files by running the same command that the script runs to backup but with the destination and target switched around.

rsync -rltpqz --delete username@remotehost.com:dir /users/home/username/

However I get this error...

/users/home/username/: is a directory
  • Have you tried using the full directory path on the remote host? – kaptk2 Nov 17 '11 at 15:15
  • Use -v (--verbose) instead of -q (--quiet) to see what it say. – quanta Nov 17 '11 at 15:20
  • sent 6699 bytes received 7261735 bytes 73791.21 bytes/sec total size is 2544027491 speedup is 350.01 ./restore.sh: line 24: /users/home/username/: is a directory – firefusion Nov 17 '11 at 15:40
  • Take out the --delete, you don't want to clobber any files not in the backup. – Andrew Nov 17 '11 at 23:34

You have to remain cognizant of the directory structures that you're working with. Rsync is not terribly consistent in how this is handled. Been bit a few times by this myself.

If you were backing up the directory named "username" to remotehost's /dir/ directory, you're going to want that directory with the slash from remotehost to go to /users/home on the local server.

rsync -avP username@remotehost.com:dir/username /users/home/

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.