Solved

How do I start a cron job?

Posted on 2000-04-08
1
235 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

Technology Partners: 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

Suggested Solutions

Title # Comments Views Activity
Linux : can't create transaction lock error 1 86
SQUD PROXY SERVER, UNIX, SLL/HTTPS 5 118
Adding a continue option in a script 9 66
SSH to Solaris server (which uses NIS) 1 22
Hello fellow BSD lovers, I've created a patch process for patching openjdk6 for BSD (FreeBSD specifically), although I tried to keep all BSD versions in mind when creating my patch. Welcome to OpenJDK6 on BSD First let me start with a little …
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 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…
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.

696 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