Commit df0538ac authored by Per Cederqvist's avatar Per Cederqvist
Browse files

Initial support for restoring backups.

* lysrdiff-restore: Initial commit of a script that can restore a
  single task in a reasonably controlled manner.
parent 47c9e0f9
2009-09-23 Per Cederqvist <ceder@ryttargardskyrkan.se>
Initial support for restoring backups.
* lysrdiff-restore: Initial commit of a script that can restore a
single task in a reasonably controlled manner.
2009-08-19 Per Cederqvist <ceder@ryttargardskyrkan.se>
Updated the config for Ryttargardskyrkan.
......
#!/bin/sh
# Do a complete restore of a single task.
if [ $# != 6 ]
then
usage
exit 1
fi
disk="$1"
part="$2"
lysrdiffpart="$1/$2"
category="$3"
subcategory="$4"
server="$5"
serverpath="$6"
remoterdiff=/opt/LYSrdiff/bin/rdiff-backup
lysrdiff="/lysrdiff/$disk/perm/$part/lysrdiff"
base="$lysrdiff/backups/$category/$subcategory"
files="$base"/files
lockdir="$base"/lock
mkdir "$lockdir" || exit 1
unset SSH_ASKPASS
unset SSH_AUTH_SOCK
schema="ssh -o BatchMode=yes -o ServerAliveInterval=120"
schema="$schema -a -k -x -i /root/.ssh/backupkey"
schema="$schema %s $remoterdiff --server"
rdiff-backup --remote-schema "$schema" --null-separator \
-r now "$files" "$server"::"$serverpath"
rmdir "$lockdir"
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment