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
link|improve this question

50% accept rate
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
feedback

1 Answer

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/

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

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