View Full Version : Script does not execute with cron

05-17-2008, 02:09 AM
I've created the following shell script to rotate a log file (yes, I know about logrotate)

mv /var/spool/qmailscan/qmail-queue.backup-3.tar.gz /var/spool/qmailscan/qmail-queue.backup-4.tar.gz
mv /var/spool/qmailscan/qmail-queue.backup-2.tar.gz /var/spool/qmailscan/qmail-queue.backup-3.tar.gz
mv /var/spool/qmailscan/qmail-queue.backup-1.tar.gz /var/spool/qmailscan/qmail-queue.backup-2.tar.gz
mv /var/spool/qmailscan/qmail-queue.backup.tar.gz /var/spool/qmailscan/qmail-queue.backup-1.tar.gz


tar -cvzf /var/spool/qmailscan/qmail-queue.backup.tar.gz $LOGFILE
echo "" > $LOGFILE

And I have this cron job
30 */6 * * * /var/spool/qmailscan/qmail-queue-log-rotate.sh 2> /dev/null This should execute the script 30 minutes past every 6 hours (0030, 0630, 1230, 1830).

But while I can execute the script from the command line, if left to cron nothing seems to happen.

Any ideas?


When I do execute it from the command line, I get this:
tar: Removing leading `/' from member names
var/spool/qmailscan/qmail-queue.logWhat does "Removing leading `/' from member names" mean?