f37 -> f39
[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 -p $output
12
13 tar -C /etc/planetlab -cf - . | tar -C $output -xf -
14
15 echo "/etc/planetlab stored in $output"
16
17 exit 0
18
19
20
21