0

I am trying to copy a directory from a remote machine's root directory to this directory /root/data_directory_backup_from_backup02 in a local machine. I spent some time to fix this but no luck. Am I making any mistakes regarding this destination path?

/usr/bin/rsync -avz -e  ssh root@x.x.x.x:/backups/ /root/data_directory_backup_from_backup02

But I get the message.Could someone please help me why is so?

/usr/bin/rsync -avz -e ssh root@x.x.x.x:/backups/ /root/data_directory_backup_from_backup02 > /var/tmp/rsync_latest_run 2>&1

Unexpected local arg: /root/data_directory_backup_from_backup02 If arg is a remote file/dir, prefix it with a colon (:). rsync error: syntax or usage error (code 1) at main.c(1228) [Receiver=3.0.9]

1

Rsync incorporates ssh. I'm pretty sure something like:

rsync -avz root@x.x.x.x:/backups/ /root/data_directory_backup_from_backup02

... will work just fine.

|improve this answer|||||
  • nope not working bringing error – bhordupur Sep 8 '16 at 13:20
  • Read again. I removed the who -e ssh thing. – jawtheshark Sep 8 '16 at 13:21
  • before I posted i tried this and now again tried gives me this error ´Unexpected local arg: /root/data_directory_backup_from_backup02 If arg is a remote file/dir, prefix it with a colon (:). rsync error: syntax or usage error (code 1) at main.c(1228) [Receiver=3.0.9]´ – bhordupur Sep 8 '16 at 13:22
  • Can you give me the output of: if [ -d /root/data_directory_backup_from_backup02 ]; then echo OK ; else echo NOK ; fi – jawtheshark Sep 8 '16 at 13:25
  • 1
    yes it does work now. The problem lied here " > /var/tmp/rsync_latest_run 2>&1 " .Thanks for quick reply. – bhordupur Sep 8 '16 at 13:39

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.