Good Day,
We have a daily cron job that runs a cleanup script –
export DIRS="/opt/autonomy/AutonomyMigration/logs \
/opt/autonomy/short_staging/migrate \
/opt/autonomy/long_staging/migrate \
/opt/autonomy/archive_staging/migrate"
for d in $DIRS
do
find $d -ctime +3 -exec rm {} \; >> ~/custom/logs/crontab.log 2>&1
done
Unfortunately, it leaves behind it the empty directories –
autonomy @ sbkj2ksrchidxs01 :: /opt/autonomy/short_staging/migrate
drwxr-xr-x 3 autonomy text 4096 Jun 17 01:01 20100617_010102
drwxr-xr-x 3 autonomy text 4096 Jun 18 01:01 20100618_010101
drwxr-xr-x 3 autonomy text 4096 Jun 19 01:01 20100619_010101
drwxr-xr-x 3 autonomy text 4096 Jun 20 01:01 20100620_010102
drwxr-xr-x 3 autonomy text 4096 Jun 21 01:01 20100621_010101
So the question is, how can the script handle these directories as well?
Regards,
Dan
We have a daily cron job that runs a cleanup script –
export DIRS="/opt/autonomy/AutonomyMigration/logs \
/opt/autonomy/short_staging/migrate \
/opt/autonomy/long_staging/migrate \
/opt/autonomy/archive_staging/migrate"
for d in $DIRS
do
find $d -ctime +3 -exec rm {} \; >> ~/custom/logs/crontab.log 2>&1
done
Unfortunately, it leaves behind it the empty directories –
autonomy @ sbkj2ksrchidxs01 :: /opt/autonomy/short_staging/migrate
drwxr-xr-x 3 autonomy text 4096 Jun 17 01:01 20100617_010102
drwxr-xr-x 3 autonomy text 4096 Jun 18 01:01 20100618_010101
drwxr-xr-x 3 autonomy text 4096 Jun 19 01:01 20100619_010101
drwxr-xr-x 3 autonomy text 4096 Jun 20 01:01 20100620_010102
drwxr-xr-x 3 autonomy text 4096 Jun 21 01:01 20100621_010101
So the question is, how can the script handle these directories as well?
Regards,
Dan