/
Setting Up CronTab

Setting Up CronTab

Search the IFS Workflow Wiki

Back to Tips and Tricks    

Introduction

The Cron background process is a long-running service application that runs commands at specific dates and times. You can use this to schedule activities, either as one-time events or as recurring tasks. For commands that need to be run repeatedly, for example hourly, daily, or weekly, you can use the crontab command. The crontab command creates a crontab file containing commands and instructions for the cron process to run.

 

UNIX and LINUX Setup

UNIX and LINUX Setup

Add Commands to the CronTab File

On most systems, you must get permission from the system administrator before you can submit job requests to cron. On some shared systems, because there is only one crontab file, only the administrator has access to the crontab command.

 To add commands to the CronTab file:

  1. Login as root user

  2. To edit the file, in a text editor, open the following file: /etc/crontab

  3. In the crontab file, the timing of commands is listed according to the format:

minute hour day-of-month month day-of-week user command

where:

TIMING

VALUES

DESCRIPTION

Minute

A number between 0 and 59

The minute of the hour when the command is executed.

Hour

A number between 0 and 23.

0 is midnight

The hour when the command is executed.

Day of the Month

A number between 1 and 31

Day of the month when the command is executed. For example, 20 would be the 20th day of each month

Month

  • A number between 1 and 12

OR

  • The first three letters of the month in English, such as Jan, Feb, etc.

Month when the command is executed.

Day of Week

  • A number between 0 and 7, where 0 and 7 are both Sunday.

OR

  • The first three letters of the day in English such as Sun, Mon, etc

Day of the week when the command is executed.

User

alpha-numeric

The username of the user who will execute the command

Command

alpha-numeric

Command, script or program to execute.

4. Make any changes necessary to meet your needs.

5. Save and close the file.

 

Examples

*/15 * * * * root php -f /opt/processmaker/workflow/engine/bin/cron.php */20 */2 * * * root php -f /opt/processmaker/workflow/engine/bin/messageeventcron.php

 

Current Dev setup:

HELL=/bin/bash

PATH=/sbin:/bin:/usr/sbin:/usr/bin

MAILTO=''

HOME=/

 

# For details see man 4 crontabs

 

# Example of job definition:

# .---------------- minute (0 - 59)

# |  .------------- hour (0 - 23)

# |  |  .---------- day of month (1 - 31)

# |  |  |  .------- month (1 - 12) OR jan,feb,mar,apr ...

# |  |  |  |  .---- day of week (0 - 6) (Sunday=0 or 7) OR sun,mon,tue,wed,thu,fri,sat

# |  |  |  |  |

# *  *  *  *  * user-name command to be executed

 

*/1 * * * * root php -f /opt/processmaker/workflow/engine/bin/cron.php

*/1 * * * * root php -f /opt/processmaker/workflow/engine/bin/messageeventcron.php

*/1 * * * * root php -f /opt/processmaker/workflow/engine/bin/timereventcron.php












Copyright© 2024 IFS AB. Copying prohibited. All rights reserved.