Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I need to do a backup on a website, but I need to download locally to a folder on my hard drive.

Example: scp name.zip -> MyMac/Documents/Backup

This can be done via shell, Terminal, etc. What is the best method for this?

share|improve this question

1 Answer 1

scp [user@]vps.example.com:name.zip ~/Documents/Backup/ will do what you want.

The scp(1) manual page has the details, but the syntax scp ${from} ${to}, where from and to are of the form: ${host}:${path} or ${path}.

You might also be interested in sftp, which is an FTP-like interactive experience, rather than the command-line scp experience; sftp vps.example.com will get you going there.

share|improve this answer
    
Thank you for the answer.i try this scp vps.example.com:name.zip ~/Documents/Backup/ but not works –  Thomas Feb 1 '12 at 0:34
1  
You will have to include the error message to have a hope of anyone else telling you why. Did you literally type vps.example.com in there? You can't just copy and paste my example, you need to use the name of your system and all. –  Daniel Pittman Feb 1 '12 at 0:35
    
yes,i use my host and username..but "Permission denied, please try again." –  Thomas Feb 1 '12 at 0:44
    
It could by the file has the wrong permissions, you got your login details wrong, the server only allows key based logins, or they have disabled scp. The last is very unlikely, though, because scp is very little different to ssh vps.example.com cat /path/to/file and all. –  Daniel Pittman Feb 1 '12 at 1:00
    
In case it is unclear, you should run the command on your local machine. –  Nathan Grigg Feb 2 '12 at 0:43

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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