Odoo12 Cron Jobs Execute on specific days - python-3.x

I have written cronjobs in odoo12 and I want them to execute 6 days in a week with exemption of sundays since sunday is not a working day, how can i do that in odoo12/odoo11

You can do one thing run cron everyday but while executing the function you can skip there put condition there of not executing your function on sunday.

Related

cronjob executed on wrong day

I want a script to be executed each first Saturday of a quarter.
Therefore I have set a crontab line up with the following
24 9 1-7 1,4,7,10 6 /absolute/path/to/script
This script was now executed yesterday, at 9:24 (ok),on Saturay (ok), but on October(ok) 16th(NOK).
Any hints what I missed or misunderstood?
Thanks a lot.
The script runs every day the first 7 days and every Saturday of the specified months.
The reason is well explained in this crontab guru page (and crontab(5)'s man page). The relevant piece is:
Note: The day of a command's execution can be specified in the following two fields --- 'day of month', and 'day of week'. If both fields are restricted (i.e., do not contain the "*" character), the command will be run when either field matches the current time. For example,
"30 4 1,15 * 5" would cause a command to be run at 4:30 am on the 1st and 15th of each month, plus every Friday.
You can check that this is indeed what happens by checking the description and when your script will be run next ("next at") here.
The way to achieve what you want, i.e., run the script on the first Saturday, is described in other questions/answers. See, for instance, Run a cron job on the first Monday of every month? or How to schedule to run first Sunday of every month. In short, replace 6 with * and combine your command with a call to date.

How to schedule a Cron job for multiple days every month?

I wish to schedule a airflow job for specific set of dates every month, for example 11th and last day of every month and used the below scheduler expression
25 14 11,L * * # At 2:45 pm on 11th and last day of every month
When I validated the above in https://crontab.guru/ and http://cron.schlitt.info/ i was told the expression as invalid.
Is it possible to schedule together for a known and a unknown (here last) day of every month? If not is there any other way to achieve this?
maybe your cron does not support the "L" flag. you can refer to this CRON job to run on the last day of the month

Cron job for every weekday at 6 am

I was wondering if anyone knew how to create a cron job that runs from monday to friday at 6am.
I am using gitlab CI, quickly looked at the example syntax and am not exactly sure how to limit it to occur from monday to friday.
Not sure what about gitlab CI, but cron syntax is minute, hour, day of month, month, day of week, meaning job which should run every week day from 6am is
0 6 * * 1-5

use whenever gem to setup biweekly cron job

Is there anyway to schedule cron jobs using whenever to run every two weeks, meaning first Saturday of the month and the third Saturday of the month.
How about the following:
require 'activesupport'
every :saturday do
month_day = Date.today.mday
if (1..7).include?(month_day) || (15..21).include?(month_day)
# YOUR TASK
end
end

Cron Job every second week day

I need a cron job to run every second weekday for example
If cron job last ran on a Thursday it should run on the next Monday
The re-run on Wednesday and again on Friday again and on Tuesday and again on Thursday bring it back to the start.
Thanks
Run it every weekday, and have the script set a flag in a file that says whether it did the work the on the previous run. If it did, it skips the work that time and inverts the flag.

Resources