LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (http://www.linuxquestions.org/questions/linux-software-2/)
-   -   Trying to rsync from remote to local (http://www.linuxquestions.org/questions/linux-software-2/trying-to-rsync-from-remote-to-local-833851/)

dooley28 09-22-2010 02:40 PM

Trying to rsync from remote to local
 
Hey all,

I'm trying to rsync a folder(and all subfolders) down to a local directory, upon completion I'd like the remote folder to be deleted.

What I've come up with is

Code:

rsync -rvtW --remove-sent-files -e ssh user@example.com:/remote/folder /local/folder
What this is doing is simply wiping the remote files within folders(not the folders themselves) and not actually syncing anything down to my local folder(as in no files at all on my /local/folder)

Can anyone help with this?

Jerre Cope 09-23-2010 01:03 AM

I think one problem is a missing trailing / on the source. Try:

rsync -rvtW --remove-sent-files -e ssh user@example.com:/remote/folder/ /local/folder

I'm not sure why you'd use the -W option with rsync. If you're going to do that, rcp would work as well and you wouldn't need rsync on both machines.

Maybe:

rsync -arzv -e ssh user@example.com:/remote/folder/ /local/folder && ssh user@example "rm -rf /remote/folder"


All times are GMT -5. The time now is 05:34 AM.