crontab - run immediately?
7,102
Solution 1
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
Solution 2
I use this which runs scripts in much the same environment as cron:
echo "command" | at NOW
Related videos on Youtube
Author by
Jamie
Updated on September 17, 2022Comments
-
Jamie over 1 year
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.
-
max_ about 14 yearsOk, 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.
-
Sandokas about 14 yearsthere 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.
-
William Pursell about 14 yearsIn 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)
-
user2910702 almost 14 yearsExcept that
at
picks up the current environment; also,diff -u /etc/pam.d/{cron,atd}
shows a few differences.