Alright folks, here's the situation. We have files out there with naming conventions such as *.20030303 (Year Month Day only with expressions). We have a lot of them also, and my job is to clean this up with a script that I am going to put in the crontab. I'm deleting files 7 days or older. I can get the script to delete the file that is exactly 7 days old, but I can't get the loop to subtract one and run it again to delete files that are 8 days old, and so on. Here is my script. I would appreciate any help I get. #!/bin/ksh
+2 ###VARIABLES###
+3 date1=`date +%Y%m%d`
+4 date2=`expr $date1`
+5 less=$(($date2 - 7 ))
+6 less1=$(($less - 1 ))
+7 ##SCRIPT###
+8 cd /dso/mis/scripts/delhislog
+9 while [[ $less > $less1 ]]
+10 do
+11 rm *.$less1
+12 done
+13 expr=`$less1 - 1`
+14 return
Please HELP!!!. Thanks a lot.
Jason Alge
+2 ###VARIABLES###
+3 date1=`date +%Y%m%d`
+4 date2=`expr $date1`
+5 less=$(($date2 - 7 ))
+6 less1=$(($less - 1 ))
+7 ##SCRIPT###
+8 cd /dso/mis/scripts/delhislog
+9 while [[ $less > $less1 ]]
+10 do
+11 rm *.$less1
+12 done
+13 expr=`$less1 - 1`
+14 return
Please HELP!!!. Thanks a lot.
Jason Alge