Solved

How do I start a cron job?

Posted on 2000-04-08
1
243 Views
Last Modified: 2011-09-20
I want to start cron job that should run every day at a given time.
How do I do that?
How do I know if the cron daemon is started?
0
Comment
Question by:rj2
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 40

Accepted Solution

by:
jlevie earned 100 total points
ID: 2696372
Unless it's been specifially disabled, cron will be running by default on any Unix system. You can verify that it's running by executing "ps -ef | grep cron | grep -v grep" on a SysV box or "ps -ax | grep cron | grep -v grep" on BSD.

To schedule a cron job to be run, say from root's crontab, every day at 9pm you'd execute "crontab -e" as root and add a line like:

0 21 * * * /path-to/my-job

From a manpage for crontab(5) the date/time fields are:

field          allowed values
minute         0-59
hour           0-23
day of month   1-31
month          1-12 (or names, see below)
day of week    0-7 (0 or 7 is Sun, or use names)

A  field  may  be an asterisk (*), which always stands for ``first-last''. There are other possibilities for the date/time fields, see your manpage for crontab.
0

Featured Post

The Ultimate Checklist to Optimize Your Website

Websites are getting bigger and complicated by the day. Video, images, custom fonts are all great for showcasing your product/service. But the price to pay in terms of reduced page load times and ultimately, decreased sales, can lead to some difficult decisions about what to cut.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When you do backups in the Solaris Operating System, the file system must be inactive. Otherwise, the output may be inconsistent. A file system is inactive when it's unmounted or it's write-locked by the operating system. Although the fssnap utility…
This tech tip describes how to install the Solaris Operating System from a tape backup that was created using the Solaris flash archive utility. I have used this procedure on the Solaris 8 and 9 OS, and it shoudl also work well on the Solaris 10 rel…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.

691 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question