crontab runs and stops in middle of process. Strange!
I created a crontab (as root) to backup my files daily. The script I execute on the command line runs fine, but when I put it in the crontab, it runs partially and just exits immediately! I have tried adding the script to /etc/crontab and it does the same thing. What is going on? My script is called backup.sh :
Code:
#!/bin/sh My crontab: Code:
10 00 * * * /home/username/backup.sh |
I think you want to redirect both stdout and stderr to the log.
/bin/tar --newer-mtime $D $OPT $DEST/$D.tar.gz $SOURCE 2&> $LOGDEST/$D.log Does the destination have enough space for the archive? |
Thanks for the suggestion of the 2&>. I see that there was not even a mount to the correct path, according to the revised log. I fixed that and everything seems to be working fine. Thanks!
|
All times are GMT -5. The time now is 11:26 PM. |