X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=tools%2Fsfsnapshot;h=c9c56bd6ec929ad1dde0ded6ad3a96b6fb9502fb;hb=0ebaa6c29736d1c0c52a4c66d9f593bda32fe943;hp=5cbdfb4352cbbcee860773080119933297ef1cbe;hpb=7e4aefaa0b128815cb0d92796ba7091b7aa5ccc1;p=nagiosplug.git diff --git a/tools/sfsnapshot b/tools/sfsnapshot index 5cbdfb4..c9c56bd 100755 --- a/tools/sfsnapshot +++ b/tools/sfsnapshot @@ -3,10 +3,12 @@ # Butchered version of snapshot # Can only run on the shell compile farm server # Will always create a snapshot of HEAD -# If want multiple snapshots, just run with "sfsnapshot {branch} [branch2 ...]" +# If want multiple snapshots, just run with "sfsnapshot [branch ...]" # Assumes: # ssh setup to send to shell.sf.net and $CF without password prompt -# autconf and automake installed on shell cf at v 2.57 & 1.72 and in PATH +# the compile server has all the prerequisites stated at http://nagiosplug.sourceforge.net/developer-guidelines.html +# Install in cron with something like: +# 47 * * * * $HOME/bin/mail_error -o $HOME/sfsnapshot.out -m tonvoon@users.sf.net sfsnapshot r1_3_0 function die { echo $1; exit 1; } @@ -17,46 +19,57 @@ function make_dist { v="$1-" else cvs_rel="HEAD" - v="" + v="HEAD-" fi # Get compile server to do the work # Variables will be expanded locally before being run on $CF - ssh $CF <<-EOF + ssh $CF </dev/null) +files=$(ls $IN/*.gz 2>/dev/null) [[ -z $files ]] && die "No files created" -ssh $OUT_SERVER "rm -f $OUT/*.gz" -scp $files $OUT_SERVER:$OUT +ssh -2 $OUT_SERVER "rm -f $OUT/*.gz" +scp -2 $files $OUT_SERVER:$OUT # Create MD5 sum -ssh $OUT_SERVER << EOF +ssh -2 $OUT_SERVER << EOF cd $OUT -md5sum *.gz > MD5SUM +cat <<-END_README > README +This is the daily CVS snapshot of nagiosplug, consisting of the CVS HEAD +and any other branches +The MD5SUM is: +END_README +md5sum *.gz | tee -a README > MD5SUM EOF rm -f $files +# Work out success or failure +expected=$(($# + 1)) +set -- $files +[[ $# -ne $expected ]] && die "Expected $expected, got $#" +exit 0