Simpsons: How Do You Feel Today? v1.0 MV Backup Server Safe Shutdown Utility

Server machine configuration

On the backups storage server machine you only need to configure rsync as server, listening for connection. This is my /etc/rsyncd.conf:

use chroot = false
strict modes = false
log file = /var/run/rsync.log

[<module_name>]   #must match the <module_name> used in the rsyncBackup.sh script 
	path = <backups_storage_path>   #for example /backups
	comment = My <module_name> backup area
	read only = false
	list = yes
	auth users = <user>   #must match the <user> used in the rsyncBackup.sh script
	secrets file = /etc/rsyncd.scrt	
	hosts allow = <list_of_allowed_hosts>   #for example mydomain.com

The file should be pretty self explicative; one note about the secrets file: it can be a file with a single line such as

john:MyPassword

and it is used to authenticate the rsync file transfer.

As anticipated above, It is possible to run rsync server on a Windows machine, instead of a Linux one, in that case, you need to use cygwin; if your are interested in this, drop me a mail.

That’s it. Now you can test your backup plan by invoking at command line of your client machine /full/path/to/your/darBckScript.sh F, then /full/path/to/your/darBckScript.sh D

Recovering your backup to a clean machine

The restoration process is very simple, you have to do it first for the full backup, and then for the differential ones. To automate this process i’m using the script suggested by the dar mini-howto:

#!/bin/sh

if [ -n "$3" ]; then
   CMD="$1"

   INPUT="$2_data"
   FS_ROOT="$3"
   $CMD -x "$INPUT" -w -R "$FS_ROOT"
   for file in ${INPUT:0:8}*_diff*; do
      $CMD -x "${file:0:15}" -w -R "$FS_ROOT"

   done
   echo "All done."
else
   echo "Not enough parameters.

Usage: script dar_location base_full_backup directory

Where dar_location is a path to a working dar binary, base_full_backup
is a date in the format 'YYYY-MM-DD', and directory is the place where
you want to put the restored data, usually '/' when run as root."
fi

The script is pretty self explicative. The only things you would care is the -w switch, which tells DAR to overwrite found files. This is necessary for differential backups. Oh, and place the script in the same directory where you put your backup files. Here’s an usage example:

./recover.sh /usr/local/bin/dar 2003-10-01 /tmp/temp_path/  

Try to run that as a normal user with a few of your backup files. You can put the result in a temporary directory, so the nice thing is you don’t have to wipe your hard disk to test it.

I would love to hear from anyone who has any success with these instructions. Let me know if there is anything I missed.

Please consider supporting this project with a donation if it has been helpful to you.
Warning. The content of this article, and related downloads, is provided as-is; use at your own risk; no warranty; no promises; enjoy!
For more informations, please consult my disclaimer page.
Share and Enjoy:
  • Digg
  • del.icio.us
  • Technorati
  • Sphinn
  • Facebook
  • LinkedIn
  • Live
Pages: 1 2 3
Improve Microon Lounge rating this post
Tell me what do you think about "Implementing a remote Linux backup plan with Dar and Rsync": I'll write better and better entries.
1 Star2 Stars3 Stars4 Stars5 Stars (2 votes, average: 4.50 out of 5)
Loading ... Loading ...

Leave a Reply


your name
your e-mail address
your website/url

Isn't this worth at least €1?

Any donation is appreciated, consider a €1 donation for each download (or maybe €1.35 since PayPal takes €0.35 from a €1.00 donation). Your support allows me to continue to create free software.