FCron: schedule command almost each day on different intervals
Submitted by Bram Schoenmakers on 16 November, 2006 - 00:26.
Tagged: FCron
With fcron I couldn't find a way to enter a command with the following schedule: run daily, except on each first of the month, a command between 5am and 7am or between 6pm and 10pm.
The following line does not work:
%days * 5-21~7~8~9~10~11~12~13~14~15~16~17 2-31 * * echo "Hello"
This command runs daily, except on the first of the month, between 5am and 6am and between 6pm and 10pm. I would've expected this would one run once since I specified one interval, but apparently the ~n flag splits it into two intervals (which makes sense after some thought).
Solution:
%daily * 5-7,18-21 [ `date +%d` != '01' ] && echo "Hello"