Using SSH to backup a directory?


#1

I’m trying to learn to use SSH to backup my websites and I want to make sure I’m doing it correctly, as I wouldn’t want to blow up the server or something…

I logged into my account using Putty, used the “ls” and “cd” commands to browse to the directory I want backed up, and the executed “zip -r backup.zip ./”

Is that the correct way to do it? It seemed to work pretty fast (I don’t know how much CPU it takes up, though?) and will be MUCH easier then backup up 2,000 files through an FTP program!


#2

That way should work fine, as long as your processess are not being killed by our monitor daemons. Really, I think the very best way to use SSH to backup data is to use rsync, as detailed here:

http://wiki.dreamhost.com/Rsync_Backup

This keeps you up to date without the processing and storage overhead of archiving, which wastes a lot of space and can lead to you ending up with a lot of identical copies of file (unless you manage it aggressively).