cancel
Showing results for 
Search instead for 
Did you mean: 

CRONTAB how to use

Former Member
0 Kudos

The system is a cluster composited by a CI e a DB.

In DB13 we dont schedule anything, but we use CRONTAB (AIX)

I would like to schedule update statistics (db check is already configured), but i dont know how to do it?

I have to log as SIDAMD or root?

the command is crontab?

pls help me

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hello Sleep,

A crontab file contains entries for each cron job. Entries are separated by newline characters. Each crontab file entry contains six fields separated by spaces or tabs in the following form:

minute hour day_of_month month weekday command

These fields accept the following values:

minute = 0 through 59

hour = 0 through 23

day_of_month = 1 through 31

month = 1 through 12

weekday = 0 through 6 for Sunday through Saturday

And command a shell command

You must specify a value for each field. Except for the command field, these fields can contain the following:

A number in the specified range. To run a command in May, specify 5 in the month field.

Two numbers separated by a dash to indicate an inclusive range. To run a cron job on Tuesday through Friday, place 2-5 in the weekday field.

A list of numbers separated by commas. To run a command on the first and last day of January, you would specify 1,31 in the day_of_month field.

An * (asterisk), meaning all allowed values. To run a job every hour, specify an asterisk in the hour field.

<b>Crontab parameters:</b>

-e Edits a copy of your crontab file or starts an editing session if you don't already have a crontab file. When editing is complete, the entry is installed as your crontab file. The editing session is started using the editor specified by the EDITOR environment variable. The default editor is vi.

-l Lists your crontab file.

-r Removes your crontab file from the crontab directory.

-v Lists the status of your cron jobs

Examples:

To run the calendar command at 6:30 a.m. every Monday, Wednesday, and Friday, enter:

30 6 * * 1,3,5 /usr/bin/calendar

To run the calendar command every day of the year at 6:30, enter the following:

30 6 * * * /usr/bin/calendar

You can login with ora<sid> user & schedule your job

Regards,

Ammey Kesarkar

<i>'Award points for useful info'</i>

Former Member
0 Kudos

thanks so much!

Answers (0)