Hacker News new | past | comments | ask | show | jobs | submit login

And the subtle differences between a cronjob’s shell environment and your command prompt’s shell environment can be maddening.

This is my favorite thing to complain about with cron. I can't believe that there's still not a way to test run cron entries. So far I just add > tmp.out >> tmp.err, set it to run every minute, and wait.




http://serverfault.com/questions/85893/running-a-cron-job-ma...

I completely agree that there should be a better, direct way to test cron jobs.


I used to do this by exec()ing a shell with no environment. 'Twasn't perfect, but it caught a lot of irritating little errors.


You should set some variables (SHELL, PATH, HOME) in your crontab. Just run "sudo env -i SHELL=... PATH=... HOME=... cmd"; this should work if cron would work.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: