HOW TO: Backing up files with 1 line of code

rsync -avz /my/folder/ user@SERVERIP:/home/user/my/folder

Yup, that's it. All you do is enter the above command on your source server and hit enter, you'll be prompted for your password and then the backup will begin!

Now of course this is far from ideal for an automated backup, for that you'll want to setup a secure RSA key and use this code:

rsync -avz -e "ssh -i /user/.ssh/id_rsa" /my/folder/ user@SERVERIP:/home/user/my/folder

Yeah, not much more than the first line, but this one doesn't ask for a password so you can set this up to run as a cron so you can sleep good at night.

  • 1 A felhasználók hasznosnak találták ezt
Hasznosnak találta ezt a választ?

Kapcsolódó cikkek

HOW TO: Cancel your service

Login to the Client Area. Click on "My Services" under the "Services" tab at the top. Click...

HOW TO: Creating an SSH RSA Key with PuTTYgen.exe

1) Open PuTTYgen.exe set the type to SSH2 RSA and minimum 1024 bits.2) Click "Generate" and move...

HOW TO: Backup your MySQL database

The easiest way to automatically backup your database is with a simple cron job running the...

HOW TO: Automatically backup your user data with rsync

Here is a quick and easy way to backup your files and MySQL database with a simple script:...

HOW TO: Setup a very basic Debian VNC server (XFCE4 Desktop)

For those of you who are interested in adding a GUI to your server that you can connect remotely...