Connecting Tech Pros Worldwide Forums | Help | Site Map

how to set Cron Job on Gentoo webmin panel?

Newbie
 
Join Date: Sep 2009
Posts: 13
#1: Sep 23 '09
I some script located in following file

http://myserver/imp/dothis.php

I want to set cron job so that this file will run daily.
At Webmin I have menu 'Scheduled Cron Jobs' and create new cron job option.
But I don't have idea how to set command for cron job and how to set time or day for it.
I am new this Cron set up.Please can you explain me with example.

Thank you very much.

dlite922's Avatar
Expert
 
Join Date: Dec 2007
Location: Moon, Dark Side
Posts: 1,095
#2: Sep 23 '09

re: how to set Cron Job on Gentoo webmin panel?


are you familiar with the command line?

A cron job is just a command that you execute from the command line shell.

For example, to delete everything from the temp folder it could be something like

rm -rf /tmp/*

To make it run everyday

* 1 * * * rm -rvf /tmp/* >> /logs/tempDelete.log

It means for every minute of every 1 day of every month and year (any weekday) remove recursively by force every file in the /tmp folder then put the verbose output into a file called tempDelete.log in the logs folder.





Dan
Dormilich's Avatar
Moderator
 
Join Date: Aug 2008
Location: Leipzig, Germany
Posts: 3,660
#3: Sep 23 '09

re: how to set Cron Job on Gentoo webmin panel?


Quote:

Originally Posted by dlite922 View Post

* 1 * * * rm -rvf /tmp/* >> /logs/tempDelete.log

this line goes into /etc/crontab
Plater's Avatar
Moderator
 
Join Date: Apr 2007
Location: New England
Posts: 7,161
#4: Sep 23 '09

re: how to set Cron Job on Gentoo webmin panel?


And the ">>" is append and not overwrite like ">"
numberwhun's Avatar
Site Moderator
 
Join Date: May 2007
Location: New Hampshire
Posts: 2,572
#5: Sep 27 '09

re: how to set Cron Job on Gentoo webmin panel?


And when you run the /etc/crontab command, you do it as such:

Expand|Select|Wrap|Line Numbers
  1. /etc/crontab -e
  2.  
I would also highly suggest that you read "man crontab" so that you are better informed about each field. Crontab is easy to use and you can do a lot with it, but you just need to read, learn and practice with it.

Regards,

Jeff
Reply

Tags
cron job