Crontab

Great infos here http://www.adminschoice.com/crontab-quick-reference/

When we want some scripts to be executed automatically in certain time periods we can use crontab

SETTING ENVIRONMENT VARIABLES

If we want to set some environments, we can either put them in a script itself, or we can put it in the crontab before calling a command using the internal SOURCE command

* * * * * source /home/oracle/.bash_profile; <command>

1>

this is used to redirect the standard output

2>

this is used to redirect the error output

2>&1

this is used to redirect the error output into the standard output

Time of execution of crontab

*     *     *   *    *        command to be executed
-     -     -   -    -
|     |     |   |    |
|     |     |   |    +----- day of week (0 - 6) (Sunday=0)
|     |     |   +------- month (1 - 12)
|     |     +--------- day of        month (1 - 31)
|     +----------- hour (0 - 23)
+------------- min (0 - 59)
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: