Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cron job to run every 1st day of the month [closed]

Tags:

cron

crontab

I need to create a cron job that will run on the every 1st day of the month every minute of this day. I will create it from cpanel.

Any help is appreciated. Thanks

like image 562
Eng Hany Atwa Avatar asked Nov 09 '13 10:11

Eng Hany Atwa


People also ask

How do I schedule a cron to run on the first Sunday of every month?

You need to combine two approaches: a) Use cron to run a job every Sunday at 9:00am. b) At the beginning of once_a_week , compute the date and extract the day of the month via shell, Python, C/C++, ... and test that is within 1 to 7, inclusive. If so, execute the real script; if not, exit silently.

How do I run cron on last day of the month?

Some cron implementations support the "L" flag to represent the last day of the month. If you're lucky to be using one of those implementations, it's as simple as: 0 55 23 L * ? That will run at 11:55 pm on the last day of every month.


1 Answers

The crontab entry should look like this :

* * 1 * * cmd_to_run

The columns mean

every minute

every hour

1st day of month

every month

any day of week, and then the command.

I'm not sure about cpanel admin

like image 191
X Tian Avatar answered Nov 19 '22 22:11

X Tian