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
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.
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.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With