I am trying to setup a Cron job using Webmin to run every 5 min. It needs to target a .php file and run the php script in that file. When I enter the path to the file in the "Command" field, it doesn't work. I am just wondering what I am doing wrong, and where do I put the file path that I need the Cron job to run.
Thanks!
The /etc/crontab file and the files under the /etc/cron. d directory contain jobs that are part of packages, such as those that are part of your distribution. If a package like 'anacron' is used on the server a few more directories will be used by the cron system but most likely going unnoticed by Scheduled Cron Jobs.
To add a cron job that runs as root, you can edit root's crontab by running sudo crontab -e . The most flexible way is to use the system crontab /etc/crontab which you can edit only with root privileges.
basic 3. /usr/bin/vim. tiny 4. /bin/ed Choose 1-4 [1]: Make a new line at the bottom of this file and insert the following code. Of course, replace our example script with the command or script you wish to execute, but keep the */5 * * * * part as that is what tells cron to execute our job every 5 minutes.
System -> Scheduled Cron Jobs
Click Create a new scheduled cron job
.In Command box enter /usr/bin/php -q /var/www/path/to/your_php_script.php
Click "Times and dates selected below .." radio button
Click "Selected.." under Minutes section
Select 0, 5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55 (use control key) and click 'Save' button
.If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With