Solved

How do I start a cron job?

Posted on 2000-04-08
1
213 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 100 total points
Comment Utility
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

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

I have been running these systems for a few years now and I am just very happy with them.   I just wanted to share the manual that I have created for upgrades and other things.  Oooh yes! FreeBSD makes me happy (as a server), no maintenance and I al…
FreeBSD on EC2 FreeBSD (https://www.freebsd.org) is a robust Unix-like operating system that has been around for many years. FreeBSD is available on Amazon EC2 through Amazon Machine Images (AMIs) provided by FreeBSD developer and security office…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…

771 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now