5748845 [rkeene@sledge /home/rkeene/projects/scripts]$ cat -n do_dact_snapshot.sh
 1 #!/bin/bash
 2 
 3 DACTSRCDIR=~rkeene/devel/dact/
 4 DACTSSDIR=~rkeene/public_html/files/oss/dact/snapshot/
 5 
 6 cd ${DACTSRCDIR} || exit 1
 7 ../makearch/makearch.sh snapshot >/dev/null 2>&1 || exit 0
 8 cd ../
 9 SSFILE=`ls -rtc1 dact-*.tar.gz 2>/dev/null | tail -1`
10 if [ -z "${SSFILE}" -o ! -f "${SSFILE}" ]; then
11     exit 0
12 fi
13 
14 mv "${SSFILE}" ${DACTSSDIR}
15 cd ${DACTSSDIR}
16 LASTSSFILE=`ls -rtc1 dact-*.tar.gz | tail -2 | head -1`
17 
18 # Don't place a duplicate snapshot, remove ours if we're a dupe.
19 LASTMD5=`tar -Ozxf "${LASTSSFILE}" '*/MD5SUMS' | grep -v -e AUTHORS -e ChangeLog -e INSTALL -e HEADER -e config_help -e
	dact.txt -e README -e TODO | md5sum`
20 THISMD5=`tar -Ozxf "${SSFILE}" '*/MD5SUMS' | grep -v -e AUTHORS -e ChangeLog -e INSTALL -e HEADER -e config_help -e
	dact.txt -e README -e TODO | md5sum`
21 if [ "${LASTMD5}" = "${THISMD5}" ]; then
22     rm "${SSFILE}"
23     rm -f `ls -rtc1 /web/rkeene/files/oss/dact/snapshot/binary/dact-*.exe | tail -1`
24     # Don't bother pruning if WE didn't add something.
25     exit 0
26 fi
27 RMLIST=`ls -tc1 dact-*.tar.gz | tail +8`
28 if [ ! -z "${RMLIST}" ]; then
29     rm -f ${RMLIST} >/dev/null 2>&1
30 fi

do_dact_snapshot.sh is a script that creates the nightly DACT snapshot, if one is needed.
5748846 [rkeene@sledge /home/rkeene/projects/scripts]$

Click here to go back to the directory listing.
Click here to download this file.
last modified: 2004-03-20 06:26:11