6

I'm currently 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?

1

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. Commented 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. Commented 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) Commented 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
  • 2
    Except that at picks up the current environment; also, diff -u /etc/pam.d/{cron,atd} shows a few differences. Commented Jul 1, 2010 at 16:25

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.