0

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 [email protected]:dir /users/home/username/

However I get this error...

/users/home/username/: is a directory
4
  • Have you tried using the full directory path on the remote host?
    – kaptk2
    Nov 17, 2011 at 15:15
  • Use -v (--verbose) instead of -q (--quiet) to see what it say.
    – quanta
    Nov 17, 2011 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, 2011 at 15:40
  • Take out the --delete, you don't want to clobber any files not in the backup.
    – Andrew
    Nov 17, 2011 at 23:34

1 Answer 1

0

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 [email protected]:dir/username /users/home/

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .