[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

How do I start a cron job?

Posted on 2000-04-08
1
Medium Priority
?
257 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
1 Comment
 
LVL 40

Accepted Solution

by:
jlevie earned 400 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

A metadevice consists of one or more devices (slices). It can be expanded by adding slices. Then, it can be grown to fill a larger space while the file system is in use. However, not all UNIX file systems (UFS) can be expanded this way. The conca…
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 several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Suggested Courses
Course of the Month19 days, 9 hours left to enroll

872 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