6

I have a bunch of cron jobs which run every 30mins.

I'm currently doing some testing, and instead of setting the cron jobs to run every minute, is there a command which I can execute that'll run the cronjobs immediately?

Thanks for your help.

2 Answers 2

5

No there isn't.

Of course you can implement a different way, not using crond.

You can wrap your jobs into a script, being normally launched by cron, which you can therefore run by hand whenever you need

3
  • Ok, thanks for your comment. crontab is executed under which user? It would be useful to know so that I can set all the correct file permissions etc. Thank you.
    – Jamie
    Mar 1, 2010 at 10:03
  • 1
    there is a user crontab, and a system wide one. Run crontab -e to edit the user's one; edit /etc/crontab to act upon the system wide one.
    – drAlberT
    Mar 1, 2010 at 10:10
  • 1
    In general, a simple way to determine the environment in which cron is executing your job is to have cron run /usr/bin/env and examine the output. (eg, look for the value of USER) Mar 1, 2010 at 17:08
3

I use this which runs scripts in much the same environment as cron:

echo "command" | at NOW
1
  • 1
    Except that at picks up the current environment; also, diff -u /etc/pam.d/{cron,atd} shows a few differences.
    – Tobu
    Jul 1, 2010 at 16:25

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .