![]() |
How to start my cronjob manually?
Hi!
I would like to know how I may start a cronjob manually? thanks. |
Your cron job scheduled should be some script that you have written for some purpose. Why not run the script manually?
|
Run the content from the cron job's script field in a shell. If your cron job is this (a sample):
* * * * * php /home/me/my.php then run from the command-line the 'php /home/me/my.php' part. Note: some hosted servers would replace 'php /home/me/my.php' with something like '/ramdisk/home/me/php5 /home/me/my.php' or similar - this can be misleading. JD Linux Archive |
xpucto:
The easiest <muy facil> way to start cronjob is to place your script inside the folder --make your choice of job time frequency: hourly, daily, weekly or monthly. Then fix your time on the crontab: # crontab -e <Enter> {for help read manual about crontab: $ man crontab} To find out whether your script goes according to your expectation run it manually first: # /etc/cron.daily/your.script <Enter> If you want to be certain if cron will run it according to crontab, test set it in current time. You will need "reload" or "restart" cron daemon for that, or you want, reboot the system. Then check if your job is running: # ps axu See if your job is among the processes. Sometimes you will need wait few moments before cron starts then try ps axu it again. Goodluck. Hope it helps. |
Use SH to test your Shell Scripts.
If your Cron job is a Linux Shell Script with the ".sh" extension, you could do the following:
[root@localhost ~]# sh /etc/cron.daily/your_script.sh |
| All times are GMT -5. The time now is 05:05 PM. |