Scott, Carlos, On Sunday 27 November 2005 18:25, Scott Leighton wrote:
On Sunday 27 November 2005 5:28 pm, Carlos E. R. wrote:
No, only this change:
test -e $SPOOL/$BASE && { case $BASE in cron.hourly) TIME="-cmin +60 -or -cmin 60" ;; cron.daily) TIME="-cmin +1440 -or -cmin -1440" ;; cron.weekly) TIME="-ctime +7 -or -ctime 7" ;; cron.monthly) NOW=`date +%s` ....
You might want to check the signs, your's does not at all match mine....
test -e $SPOOL/$BASE && { case $BASE in cron.hourly) TIME="-cmin +60 -or -cmin 60" ;; cron.daily) TIME="-cmin +1440 -or -cmin 1440" ;; cron.weekly) TIME="-cmin +10080 -or -cmin 10080" ;; cron.monthly) NOW=`date +%s` LASTMONTH=`date -d "last month" +%s` DIFF=`expr '(' $NOW - $LASTMONTH ')' / 86400` TIME="-ctime +$DIFF" ;;
Note, no negative numbers anywhere. Mine works, I know that much...
Without stopping to really analyze what's being attempted, I'll just point out that with the minus sign on a time value (days or minutes, as the case may be) you're asking for times less than the stipulated number of days or minutes in the past. With a plus sign, you're asking for times greater than the specified time in the past. With neither, you're stating an exact age (though I don't know what sort of epsilon is applied in the comparison and / or the precision with which the comparison is made). Thus Scott's criteria say, to take the cron.hourly case as an example, the file's change time is either less than 60 or greater than 60 minutes, but not "exactly" 60 (whatever "exactly" means to find, as I mention above). It seems unlikely this is really what you intended, but I don't really know that, do I? On the other hand, Carlos' corresponding case says "change time greater than or equal to 60 minutes in the past."
Scott
Randall Schulz