Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

How do I start a cron job?

Posted on 2000-04-08
1
Medium Priority
?
254 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 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…
Why Shell Scripting? Shell scripting is a powerful method of accessing UNIX systems and it is very flexible. Shell scripts are required when we want to execute a sequence of commands in Unix flavored operating systems. “Shell” is the command line i…
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…
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…

610 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