Enter your email address:

Delivered by FeedBurner

Backup up your files in another server using encripted SSH


StumbleUpon Toolbar

If you have two servers, could be a good idea to make cross backups of the important data, so if any of them fails you can always restore from the other.

Here we will use rsync and ssh to make this possible, rsync is used to sync files between folders on the same machine or between machines, ssh will open an encrypted tunnel so the data could be secure on the transfer.

We will have the option to make this automatic using a cron job

Enable the ssh login with no password

I have written how to do this in the past, so you can go to this link to make it and go back once it is finished, if you do not need to automate this process you don't need this step.

http://linux.go2linux.org/?q=node/16

Prepare the backing machine

In the machine where the files are going to be copied, enter this commands

cd $HOME
mkdir backup

Create the script

This script will run on the backing machine.

#!/bin/sh
#Backup your files with automatic incremental
#Delete the files on destination that have been
#deleted on the source
rsync -e 'ssh -ax' -avz --delete --delete-excluded backed.server:/source/directory $HOME/backup/

Make this script to run in a CronJob as your user (not root, unless you want that) if you do not want this automatic, run by hand each time you want to back up your files.

Trackback URL for this post:

http://www.go2linux.org/trackback/37
StumbleUpon Toolbar

 If you like this article, subscribe to our full rss

If this article was somehow useful for you, you can leave something in the tip's jar

Please post your question in our forum and use comments only to leave your comments about the article, thanks.

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

More information about formatting options

Captcha
This question is for testing whether you are a human visitor and to prevent automated spam submissions.

This site is proudly hosted at Bluefur Hosting