Dave's Brain

Browse - computer tips - efficient rsync backup to rsync server

Date: 2010jun7
OS: Linux
Product: rsync

Q.  How can I send a backup to an rsync server?

A.  ON THE SERVER SIDE.

Make a user to own the backup:

	useradd backupuser

Set up the server in /etc/rsyncd.conf
for example:

	[myphotos]
		uid = backupuser
		gid = backupuser
		readonly = false
		path = /backups/myphotos
		comment = Photos I have taken myself
		auth users = rsync
		secrets file = /etc/rsyncd.secrets

	Make the secrets file /etc/rsyncd.secrets
		backupuser:myPASS


Start the server:

	/bin/service rsync start

ON THE CLIENT SIDE.

Make a script, called for example /usr/local/bin/backup_myphotos

	#!/bin/sh
	export USER=backupuser
	export RSYNC_PASSWORD=myPASS
	rsync --archive --checksum --compress -v /home/myphotos/ myserver::myphotos
	# The trailing slash after your source folder (/home/myphotos/)
	# is important because it requests a backup of the cotents of the
	# folder

Run your script with cron.
What this info useful to you? You can donate to say thanks

Add a comment

Sign in to add a comment
Copyright © 2008-2012, dave - Code samples on Dave's Brain is licensed under the Creative Commons Attribution 2.5 License. However other material, including English text has all rights reserved.
Advertisements: