[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Cron Problem



David Christensen wrote:
Have you tried running the script from an interactive shell?


Yes, and it works fine.


Have you redirected stdout to stdin in your cron invocation?
    root@p166d302:~# crontab -l
    0 2 * * *       /root/bin/cron-backup   2>&1


No, but I have now (I think you mean stderr to stdout). Although I've been using Linux for a while I haven't learnt much about the shell. I will hand in my geek badge at the door. I'm currently running the script from cron.d rather than crontab with the script itself rwx only for root. Other than that my set up is as you show above.


Does your script dump all it's messages into a log file and redirect stdout to
stdin when it calls other scripts?


At the moment it just just abandons it's output and relies on cron to mail it to me. I will make it write a log file as well. Oddly enough I ran the script with the compare disabled last night and I got an email this morning. The compare takes quite a while to run (about 30 minutes I would guess). If I run it as a separate job I get a mail so I don't think there is anything wrong with the compare just the amount of time it takes to run.



Reply to: