Here is my job
45 5 5 2 WED /usr/bin/python3 /home/pi/Saqib/RaspBerryPiAdhan/www/commands/player.py "/static/media/fajr1.mp3" "Office Ustairs speaker"
Jobs looks fine, as I want it to run only once in a year…however i am using a module called “croniter“…and it seems like it has a bug.
my job is SET to fire only on wed at 5 45, Feb of 5th. however when i use the get_next() method, it returns the next fire date of coming/next wednesday as well.
I need to fire it only ONCE.
my system is Linux Debian kernal.
Anyway around this?
3
Answers
This should do it:
If we talk about UNIX/Linux cron record it should be like this:
first you should use number, not name of the day of week. Then in cron relation between minutes, hours, days of month and months is AND. But day of week is in OR relation with days of month. So on your way the script will be executed on the desired date AND every Wednesday
@Romeo Ninov has the right idea!
Check https://crontab.guru/#45_5_5_2_*
45 5 5 2 * = βAt 05:45 on day-of-month 5 in February.β