January 28, 201214 yr I have a monthly parity check scheduled to run on the first of every month. How can I tell unraid to skip the check on Feb 1st but still run the others? Thx
January 28, 201214 yr Author In my go script it runs a script that contains this: #!/bin/sh crontab -l >/tmp/crontab grep -q "/root/mdcmd check" /tmp/crontab 1>/dev/null 2>&1 if [ "$?" = "1" ] then echo "# check parity on the first of every month at midnight:" >>/tmp/crontab echo "0 0 1 * * /root/mdcmd check 1>/dev/null 2>&1" >>/tmp/crontab cp /tmp/crontab /var/spool/cron/crontabs/root- crontab /tmp/crontab fi I want to disable this from running on Feb 1st. How do I do this without restarting unraid and commenting out the line in the go script?
January 28, 201214 yr At the shell prompt type crontab -e Then comment out the command. After feb 1 uncoment out that line. There are other ways to do this but thats likely the most simple. Sent from my SGH-I727R using Tapatalk
January 28, 201214 yr In my go script it runs a script that contains this: #!/bin/sh crontab -l >/tmp/crontab grep -q "/root/mdcmd check" /tmp/crontab 1>/dev/null 2>&1 if [ "$?" = "1" ] then echo "# check parity on the first of every month at midnight:" >>/tmp/crontab echo "0 0 1 * * /root/mdcmd check 1>/dev/null 2>&1" >>/tmp/crontab cp /tmp/crontab /var/spool/cron/crontabs/root- crontab /tmp/crontab fi I want to disable this from running on Feb 1st. How do I do this without restarting unraid and commenting out the line in the go script? Enter this command on the command line to get it to skip Feb 1st, but still do all the other months.. crontab -l | sed "sX^0 0 1 \* \* /root/mdcmdX0 0 1 1,3-12 * /root/mdcmdX" | crontab - It will change the line in crontab from 0 0 1 * * /root/mdcmd check NOCORRECT 1>/dev/null 2>&1 to 0 0 1 1,3-12 * /root/mdcmd check NOCORRECT 1>/dev/null 2>&1 enter this to put it back so it does every month once more: crontab -l | sed "sX^0 0 1 1,3-12 \* /root/mdcmdX0 0 1 * * /root/mdcmdX" | crontab -
Archived
This topic is now archived and is closed to further replies.