Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Setting up a cron job with Webmin

Tags:

php

cron

webmin

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!

like image 960
John Avatar asked Apr 29 '11 13:04

John


People also ask

Where does Webmin store cron jobs?

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.

How do I set up a crontab cron job?

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.

How do I schedule a cron job every 5 minutes?

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.


1 Answers

  1. System -> Scheduled Cron Jobs
  2. Click Create a new scheduled cron job.
  3. In Command box enter /usr/bin/php -q /var/www/path/to/your_php_script.php
  4. Click "Times and dates selected below .." radio button
  5. Click "Selected.." under Minutes section
  6. Select 0, 5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55 (use control key) and click 'Save' button.
like image 60
Naresh Kumar Nakka Avatar answered Oct 04 '22 22:10

Naresh Kumar Nakka