Here is the output of 'crontab -e':
The first one works OK. But the 2nd does not work at all.
However, while I was in /home/userID/logs and manually execute this script 'zipLogs.csh', it works just fine.
BTW, the script 'zipLogs.csh' is very simple:
I can not figure out why it does not work through cron job. By saying 'not working', I meant that there is no files with this name pattern, e.g. 'log_2007_05_30.tar.gz' created in the subdir '/home/userID/logs'! Again, when I execute it from cmdline './zipLogs.csh', it works just fine.
Could someone tell what I have missed here?
Just for your reference, the platform is linux.
Thanks for your help.
Code:
01 08 * * * /home/userID/mybin/saveLogs.pl > /dev/null 2>&1
01 09 * * * /home/userID/logs/zipLogs.csh > /dev/null 2>&1
The first one works OK. But the 2nd does not work at all.
However, while I was in /home/userID/logs and manually execute this script 'zipLogs.csh', it works just fine.
BTW, the script 'zipLogs.csh' is very simple:
Code:
#! /bin/csh -f
set today = `date +%Y_%m_%d`
echo $today
set log = "log_$today.tar"
echo "log = $log"
tar cvf $log *.log
gzip $log
\rm *.log
echo "exit ..."
I can not figure out why it does not work through cron job. By saying 'not working', I meant that there is no files with this name pattern, e.g. 'log_2007_05_30.tar.gz' created in the subdir '/home/userID/logs'! Again, when I execute it from cmdline './zipLogs.csh', it works just fine.
Could someone tell what I have missed here?
Just for your reference, the platform is linux.
Thanks for your help.