I write a script and set it as a cron job. But due to a difference of environment variables it doesn't work as it should be.
In that case I change a little bit with crontab -e
and set a cron job time closest minute, and wait next minute to come to show the result. I feel this is a totally absurd approach, but I don't know better way to do it.
If there is a way to run a script as if it is called inside cron job, I'm going to use it.
Does anyone know how to do it?
env
to run... – derobert Mar 26 '14 at 00:54cron
, just redirect the error output, run this with ityour_script.sh 2>/path/to/logfile
, that should help you understand what's going on. – terdon Mar 26 '14 at 02:18