Cron job commands

Below is php file path where your  php script reside on server

php -q /home/example/public_html/example.php

To avoid to send email to contact email when cron runs use this command:

php -q  /home/example/public_html/example.php 2>&1

Here are some examples for cron schedule

Minute       Hour      Day      Month       Weekday

======================================================

*                *            *             *                  *               Cron Every min

======================================================

*/5               *            *             *                *               Cron Every five min

======================================================

0,30                *            *             *             *             Cron twice a hour

======================================================

0                *            *             *                  *               Cron once a hour

======================================================

0               0,12           *             *               *               Cron twice a day

======================================================

0                0            *             *                  *               Cron once a day

======================================================

0                0            *             *                 0  (sun)             Cron once a week

======================================================

0                0            1,15             *             *               Cron on 1st and 15th

======================================================

0                0            1             *                   *               Cron once a month

======================================================

0                0            1            1                    *               Cron once a year

======================================================

Advertisements
By Rz Rasel Posted in Php

2 comments on “Cron job commands

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