cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
JTorrico
Level 8
Report Inappropriate Content
Message 1 of 5

Cron syntax for bi-weekly server task

Does anyone know what the correct syntax for a cron scheduled task would be if I were to run a task every 2 weeks (e.g. On the first and 15th of every month).

Tried this - 0 0 7 ? * 1F,15W

Of course that didnt work so Im stuck here. Any guide out there that shows use cases?

4 Replies
Hawkmoon
McAfee Employee
McAfee Employee
Report Inappropriate Content
Message 2 of 5

Re: Cron syntax for bi-weekly server task

Hi JTorrico,

Would something like this help?
   0 7 1-7,15-21 * 1
... would run on the 1st and 3rd Monday of a month.

or maybe
   0 08 1-7,15-21 * 3
... would run on the 1st and 3rd Wednesday of every month.

For a Saturday run the last digit would change to 6.
example: 0 08 1-7,15-21 * 6

Have a look at this URL it offers some good detail that you may find helpful:
https://www.systutorials.com/how-to-run-a-cron-job-every-two-weeks-months-days/

Was my reply helpful?

If this information was helpful in any way or answered your question, will you please select Accept as Solution in my reply and together we can help other members?

rgc1
McAfee Retired
McAfee Retired
Report Inappropriate Content
Message 3 of 5

Re: Cron syntax for bi-weekly server task


 The specifying both day of month and day of week is unsupported.

https://docs.mcafee.com/bundle/epolicy-orchestrator-5.10.0-product-guide/page/GUID-E1E6877C-E0C2-49B...

NOTE: If the month does not have a fifth Wednesday, the task does not run.

Example You can run the task  based on the day to specify.....
Example:  0 0 19 ? * 5#3"

The alternative to specify 3rd Friday of each month (adding "#3")

jon12
Level 7
Report Inappropriate Content
Message 4 of 5

Re: Cron syntax for bi-weekly server task

Hi. 

Please we need specify all Saturday less the last Saturday of each month

 

In general ¿¿how do you specify the condition without or  "all minus one"?


Regards

 

 

 

 

 

aguevara
McAfee Employee
McAfee Employee
Report Inappropriate Content
Message 5 of 5

Re: Cron syntax for bi-weekly server task

i dont think you can mix both day and month data with as we dont accept mixture of days and months

Was my reply helpful?
If this information was helpful in any way or answered your question, will you please select Accept as Solution in my reply and together we can help other members?

 

You Deserve an Award
Don't forget, when your helpful posts earn a kudos or get accepted as a solution you can unlock perks and badges. Those aren't the only badges, either. How many can you collect? Click here to learn more.

Community Help Hub

    New to the forums or need help finding your way around the forums? There's a whole hub of community resources to help you.

  • Find Forum FAQs
  • Learn How to Earn Badges
  • Ask for Help
Go to Community Help

Join the Community

    Thousands of customers use the McAfee Community for peer-to-peer and expert product support. Enjoy these benefits with a free membership:

  • Get helpful solutions from McAfee experts.
  • Stay connected to product conversations that matter to you.
  • Participate in product groups led by McAfee employees.
Join the Community
Join the Community