From: zacheiss Date: Tue, 3 Apr 2007 15:36:01 +0000 (+0000) Subject: Transfer file to a temporary filename and mv it into place if transfer X-Git-Url: http://andersk.mit.edu/gitweb/moira.git/commitdiff_plain/c83275d962841dac04faaec19df71b6baa618e88 Transfer file to a temporary filename and mv it into place if transfer was successful. --- diff --git a/gen/sapprint.sh b/gen/sapprint.sh index a32d6da8..6fdf353b 100755 --- a/gen/sapprint.sh +++ b/gen/sapprint.sh @@ -12,7 +12,8 @@ fi MR_MISSINGFILE=47836473 PATH=/bin -OUTFILE=/var/tmp/sapprint.out +OUTFILE=/var/tmp/sapprint.out.moira +DSTFILE=/var/tmp/sapprint.out # Alert if the output file doesn't exist test -r $OUTFILE || exit $MR_MISSINGFILE @@ -22,6 +23,9 @@ chown root $OUTFILE chgrp 0 $OUTFILE chmod 644 $OUTFILE +# mv file into place. +mv $OUTFILE $DSTFILE + # cleanup test -f $0 && rm -f $0