f741683478570c3aaed6d43ee6bae2c1aee01769
[infrastructure.git] / scripts / snapshot-etc-planetlab.sh
1 #!/bin/bash
2
3 date=$(date +%Y-%m-%d-%H-%M)
4 output=/root/etc-planetlab-snapshots/$date
5
6 # mention the first arg if provided in the resulting filename
7 [[ -n "$1" ]] && { message=$1 ; shift ; output="${output}-${message}" ; }
8
9 [ -d $output ] && { echo "refusing to use pre-existing target dir $output" ; exit 1 ; }
10
11 mkdir $output
12
13 tar -C /etc/planetlab -cf - . | tar -C $output -xf -
14
15
16
17