graywolf Posted February 4, 2011 Share Posted February 4, 2011 Want to check if this is what I would need to modify to change the date/time when the Monthly Parity Check runs. The GOAL is to have it kick off at 0530 on the first Monday of the Month. Would I just need to modify monthly-parity-unmenu-package.conf, or monthly_parity_check.auto_install or both? Thinking I just need to change (not sure in which file(s)): echo "0 0 1 * * /root/mdcmd check ${vCHECK_TYPE-NOCORRECT} 1>/dev/null 2>&1" >>/tmp/crontab TO echo "30 5 1-7 * 1 /root/mdcmd check ${vCHECK_TYPE-NOCORRECT} 1>/dev/null 2>&1" >>/tmp/crontab * * * * * command to be executed - - - - - | | | | | | | | | +----- day of week (0 - 6) (Sunday=0) | | | +------- month (1 - 12) | | +--------- day of month (1 - 31) | +----------- hour (0 - 23) +------------- min (0 - 59) Link to comment
prostuff1 Posted February 4, 2011 Share Posted February 4, 2011 changing this in the .autoinstall file is all you need to do. This could probably be set up as a configurable variable like I did in my DS_Store package. Link to comment
graywolf Posted February 4, 2011 Author Share Posted February 4, 2011 Also want to verify that my logic is correct. Since I specify day of week AND day of month (range) that it is an AND condition, not OR So that it will ONLY run on Monday if the day of the month is in the range of 1-7, and not end up trying to run every Monday, and everyday for the 1st thru 7th of the month. 30 5 1-7 * 1 * * * * * command to be executed - - - - - | | | | | | | | | +----- day of week (0 - 6) (Sunday=0) | | | +------- month (1 - 12) | | +--------- day of month (1 - 31) | +----------- hour (0 - 23) +------------- min (0 - 59) Link to comment
BRiT Posted February 4, 2011 Share Posted February 4, 2011 I could be mistaken, but as it is now, I do not think it will do what you want. 30 5 1-7 * 1 That will cause it to run the first 7 days of the month AND every Monday. For a working solution, have a look at this thread here: http://lime-technology.com/forum/index.php?topic=9646.0 You need a shell check before invoking the parity check, for instance: echo "30 05 1-7 * * [ \"\$(date '+%a')\" == \"Mon\" ] && /root/mdcmd check ${vCHECK_TYPE-NOCORRECT} 1>/dev/null 2>&1" >>/tmp/crontab Link to comment
Recommended Posts
Archived
This topic is now archived and is closed to further replies.