How to create data backup server using rsync ssh with time schedule

Fabio Rampazzo Mathias fmathias at lbhc.hcancer.org.br
Tue Aug 4 16:42:34 UTC 2009


Dear Jiten Jha,

At an overall view, you'll need some steps :

1. Grant access from machines to be backed up (clients) to the server  
without password (with public key (http://ubuntu-tutorials.com/2007/02/05/unattended-ssh-login-public-key-ssh-authorization-ssh-automatic-login/) 
)

2.  Create a backup script (bash is a good friend in this time)

3. Configure script to run via crontab (as you wish (man crontab))

These are the basic stuff.
The process i do here is :

1. (on the client) TAR+BZIP2 files (even mysqldumps) with name  
structure : dir-<directoy>-<date>.tar.bz2 or mysql-<database>- 
<date>.tar.bz2

2. (on the client) Using a simple bash script, i do rsync to specified  
folders :

	rsync -avz <backup-dir>/dir-* bkpuser at backup-machine:/data/diretorios/
	rsync -avz <backup-dir>/mysql-* bkpuser at backup-machine:/data/mysql/
	rm -rf <backupd-dir>/*

3. (on the server) Configure a check script to know if it had problem :

	if [ "`ls <backup-dir> | grep <date> | wc -l "` != "125" ];
	then
		echo "there's a backup problem" | mail <mymail> -s "Backup scheduler"
	fi;

That's all...

I have some diffs an deltas backups too, just "man rsync" to know more  
parameters of rsync.

Cheers,
Fábio Rampazzo Mathias

---
Hospital A.C. Camargo
Laboratório de Biotecnologia do Hospital do Câncer - LBHC
tel.: +55 (11) 2189 5000 ramal 1134
cel.: +55 (11) 8244-7894

On 04/08/2009, at 10:22, Barry Brimer wrote:

>> Dear friend,
>> I want to create data backup server using  "rsync ssh utility "  
>> with time schedule
>> then i can take backup all data from any system of my office. Then  
>> tell me the way how i can configure it.
>
> <http://www.rsnapshot.org/>--
> redhat-sysadmin-list mailing list
> redhat-sysadmin-list at redhat.com
> https://www.redhat.com/mailman/listinfo/redhat-sysadmin-list





More information about the redhat-sysadmin-list mailing list