Hello, I have the following crontab entry that does not seem to be running. When I check /var/cron/log, it is not there. Here is my os info:
SunOS birch 5.9 Generic_118558-09 sun4u sparc SUNW,Sun-Fire-V240
Here is the crontab entry:
01 21 * * * find /export/app/datafeed/flus/archive -mtime +5 -exec rm -r {} \;
Any suggestions as to why it is not executing?
Thank you.
David
Few questions to check:
Were there files with specified condition to be deleted ?
Are there necessary permissions to delete the selected files ?
The files are owned by the same user in which the crontab entry is located. Shouldn't there be logging on /var/cron/log if it attempted to run? There may not have been files old enough to be deleted at the time it was run last.
David
1 Like
For testing , U make one more entry in crontab to list those filenames which are modified morethan 5 days like this.
01 21 * * * find /export/app/datafeed/flus/archive -mtime +5 -print >$HOME/test.log
U check whether test.log is created or not.if it is created means cron is working, otherwise not.
porter
October 25, 2007, 6:03pm
5
On just a point of style and manageability, I make my crontab entries call a single script, then have the script do all the fancy foot work.
it means I can simply add any tracing I need
it means I can test exactly the same thing outside of crontab
my crontab contains the minimum, eg when and what command
dkranes
October 26, 2007, 11:01am
6
Yes, I have now done just this. I created a single script to do the work. Thank you.
David