From c7733be24afe18f717cdbb03040152910bfb67e6 Mon Sep 17 00:00:00 2001 From: Thierry Parmentelat Date: Wed, 29 Jun 2011 11:56:03 +0200 Subject: [PATCH] automate dated backups of /etc/planetlab --- scripts/snapshot-etc-planetlab.sh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100755 scripts/snapshot-etc-planetlab.sh 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 - + + + + -- 2.47.0