Author: nickboldt
Date: 2012-10-05 01:42:24 -0400 (Fri, 05 Oct 2012)
New Revision: 44329
Modified:
trunk/build/util/cleanup/jbosstools-cleanup.sh
Log:
use a smaller date string to avoid blowing the register and ending up with 15602613d
instead of 2d as age of folder
Modified: trunk/build/util/cleanup/jbosstools-cleanup.sh
===================================================================
--- trunk/build/util/cleanup/jbosstools-cleanup.sh 2012-10-05 05:09:39 UTC (rev 44328)
+++ trunk/build/util/cleanup/jbosstools-cleanup.sh 2012-10-05 05:42:24 UTC (rev 44329)
@@ -4,7 +4,6 @@
# --------------------------------------------------------------------------------
# clean JBT builds from
sftp://tools@filemgmt.jboss.org/downloads_htdocs/tools/builds/nightly
-now=$(date +%s)
log=/tmp/${0##*/}.log.`date +%Y%m%d-%H%M`.txt
echo "Logfile: $log" | tee -a $log
@@ -98,8 +97,9 @@
rm -f $tmp
for dd in $all; do
keep=0;
- # sec=$(date -d "$(echo $dd | perl -pe
"s/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})/\1-\2-\3\ \4:\5/")" +%s) # convert
buildID (folder) to timestamp, then to # seconds since epoch ## OLD FOLDER FORMAT
- sec=$(date -d "$(echo $dd | perl -pe
"s/(\d{4})-(\d{2})-(\d{2})_(\d{2})-(\d{2})-(\d{2})-(H|B)(\d+)/\1-\2-\3\
\4:\5:\6/")" +%s) # convert buildID (folder) to timestamp, then to # seconds
since epoch ## NEW FOLDER FORMAT
+ # convert buildID (folder) to timestamp, then to # seconds since 2009-01-01 00:00:00
(1230786000)
+ sec=$(date -d "$(echo $dd | perl -pe
"s/(\d{4})-(\d{2})-(\d{2})_(\d{2})-(\d{2})-(\d{2})-(H|B)(\d+)/\1-\2-\3\
\4:\5:\6/")" +%s); (( sec = sec - 1230786000 ))
+ now=$(date +%s); (( now = now - 1230786000 ))
(( day = now - sec ))
(( day = day / 3600 / 24 ))
for n in $newest; do
Show replies by date