Skip to main content
edited tags
Link
Gilles 'SO- stop being evil'
  • 865.5k
  • 205
  • 1.8k
  • 2.3k
Source Link
ironsand
  • 5.4k
  • 13
  • 55
  • 74

How to run a command as if it is called from cron

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?