How to copy all directory from another host to current host on Linux

0

My current files and directories are hosted with Godaddy.com and they don't allow scp over to another host, and I want to get all the pictures for wordpress under wp-content/uploads/* but when I tried sftp -r

#sftp> get -r uploads /www/wp-content/uploads
Invalid flag -r

I want to move from Godaddy to Site5 without scp what else I can use?

Godaddy I'm using shared hosting the 4GH, so not many option left for me

Ali

Posted 2013-04-09T05:05:53.070

Reputation: 1 151

Answers

1

Depending on what godaddy / Site5 allow you to do:

  • RSYNC: rsync [OPTIONS]... SRC [SRC]... [USER@]HOST:DEST
  • SFTP: This time archive your files first and then just SFTP the archive
    • tar czvf archive.tar.gz /wp/files-to-archive/*
    • #sftp > get archive.tar.gz

Steve N

Posted 2013-04-09T05:05:53.070

Reputation: 156

Godaddy doesn't support RSYNC and I can't archrive the very large file – Ali – 2013-04-09T10:55:43.530

How about using something like this plugin to backup your WP and have it email the zip to you. Slight over kill but the uploaded photos should be in there.

[link]http://wordpress.org/extend/plugins/backupwordpress/

– Steve N – 2013-04-09T11:03:05.163

actually I learned that your way really helped! first I was using .zip and that one really bad, so I used .tar.gz and it works like charm! now I have done all the backup – Ali – 2013-04-09T14:31:02.180

1

If you're doing this from a unix-like system, and if Godaddy supplies tar, then you can use that to pipe the files through an ssh connection. Basically, from your system you would run:

ssh remotehost 'cd /destination && tar cf - files' | tar xvf -

This avoids having to save the tarfile on the remote host. For more details, see this question.

Kenster

Posted 2013-04-09T05:05:53.070

Reputation: 5 474

I don't get it.

It's done now, but your answer is that suppose to use it just to save it or to transfer it too? because what I was looking for is to tar the file then transfer from Godaddy to anotehr host – Ali – 2013-05-03T14:37:39.007

My example shows how to copy a directory tree to your local system without creating an intermediate tarfile. That is what you were trying to do in your original question. – Kenster – 2013-05-03T14:50:23.410