DelphiFAQ Home Search:

How do I set up a cron job?

 

commentsThis article has not been rated yet. After reading, feel free to leave comments and rate it.

Question:

How do I set up a cron job? (compare to the Windows scheduler)

Answer:

You can set up cron jobs with the "crontab" command from the shell.
  • crontab -l will show you your currently set up cron jobs on the server.
  • crontab -r will delete your current cron jobs.
  • crontab -e will allow you to add or edit your current cron jobs by using your default text editor to edit your "crontab file".

If your web host does not allow you to use the crontab command and / or you do not want to (or cannot) edit the crontab file (which is usually /etc/crontab, then you might find that there are subdirectories

etc/cron.daily
etc/cron.hourly
etc/cron.monthly
etc/cron.weekly


where you can add your job as a shell script in the appropriate directory. (This is the case if your host uses the ensim environment.)
This still requires that you have write privilege in these directories.


Comments:

 

 

Email address (not necessary):

Rate as
Hide my email when showing my comment.
Please notify me once a day about new comments on this topic.
Please provide a valid email address if you select this option.
 
It seems that you are
from Washington, US .

Info/ Feedback on this

Show city and country
Show country only
Hide my location
Leave your comment here:
Please type in the code:
photo Add a picture:

Please do not post inappropriate pictures. Inappropriate pictures include pictures of minors and nudity. The owner of this web site reserves the right to delete such material.