From: Thierry Parmentelat Date: Wed, 29 Jun 2011 09:56:03 +0000 (+0200) Subject: automate dated backups of /etc/planetlab X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=c7733be24afe18f717cdbb03040152910bfb67e6;p=infrastructure.git automate dated backups of /etc/planetlab --- diff --git a/scripts/snapshot-etc-planetlab.sh b/scripts/snapshot-etc-planetlab.sh new file mode 100755 index 0000000..f741683 --- /dev/null +++ b/scripts/snapshot-etc-planetlab.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +date=$(date +%Y-%m-%d-%H-%M) +output=/root/etc-planetlab-snapshots/$date + +# mention the first arg if provided in the resulting filename +[[ -n "$1" ]] && { message=$1 ; shift ; output="${output}-${message}" ; } + +[ -d $output ] && { echo "refusing to use pre-existing target dir $output" ; exit 1 ; } + +mkdir $output + +tar -C /etc/planetlab -cf - . | tar -C $output -xf - + + + +