3 date=$(date +%Y-%m-%d-%H-%M)
4 output=/root/etc-planetlab-snapshots/$date
6 # mention the first arg if provided in the resulting filename
7 [[ -n "$1" ]] && { message=$1 ; shift ; output="${output}-${message}" ; }
9 [ -d $output ] && { echo "refusing to use pre-existing target dir $output" ; exit 1 ; }
13 tar -C /etc/planetlab -cf - . | tar -C $output -xf -
15 echo "/etc/planetlab stored in $output"