- checkpoint command requires a filename argument; before was optional
Marc Fiuczynski [Fri, 25 Jan 2008 13:56:21 +0000 (13:56 +0000)]
- restore command first restores the databases and then /etc/planetlab

guest.init

index 938a31e..db77508 100755 (executable)
@@ -190,7 +190,10 @@ case "$command" in
 
     checkpoint)
        cpfile=$1
-       [ -z "$cpfile" ] && cpfile=/var/tmp/plc_checkpoint.$(date +"%Y-%m-%d-%H-%M-%S")
+       if [ -z "$cpfile" ] ; then
+           echo "PLC: checkpoint requires a filename as an argument"
+           exit 1
+       fi 
        cpdir=$(mktemp -d tmp.XXXXXX)
        cd $cpdir
        mkdir -p ./etc/planetlab/
@@ -206,8 +209,9 @@ case "$command" in
        cpdir=$(mktemp -d tmp.XXXXXX)
        cd $cpdir
        tar xjf $cpfile
-       rsync -av ./etc/planetlab/ /etc/planetlab
        /etc/plc.d/db restore ./etc/planetlab/plc_db.checkpoint ./etc/planetlab/plc_drupal.checkpoint
+       rm -f ./etc/planetlab/plc_db.checkpoint ./etc/planetlab/plc_drupal.checkpoint
+       rsync -av ./etc/planetlab/ /etc/planetlab
        cd -
        rm -rf $cpdir
        ;;