Sunday, April 28, 2024
 Popular · Latest · Hot · Upcoming
4
rated 0 times [  4] [ 0]  / answers: 1 / hits: 732  / 2 Years ago, sun, september 11, 2022, 11:30:00

I'd like to use anacron to run a job annually. I see only daily, weekly, and monthly configuration for anacron. Is there a way to run a job once per year?


More From » 12.04

 Answers
1

Ofcourse and it is already there with the possible selections you have: pick 1 specific day and 1 specific month and it will run once per year. Day 1 of month 1 would be on the 1st of January.



Anacron has 2 ways of defining lines. The 2nd one is like this:



 @period_name delay job-identify command


The period_name can be set to daily, weekly, monthly, yearly or annualy. This will ensure jobs are run once a week, month or year no matter the number of days in this period.



Example



@yearly 0 job1 /usr/bin/execute_me


The 0 means no delay. job1 is an identifier and the command to execute.


[#34044] Monday, September 12, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
ongdiligenc

Total Points: 452
Total Questions: 111
Total Answers: 107

Location: Ukraine
Member since Sun, Dec 13, 2020
3 Years ago
;