We have a cron job under a specific user's crontab which should be running only on working week days. Job was running all days before we changed it.
After we changed in the following line the days statement from '*' to '1-5', testscript.sh is still running all days and the weekend that is not supposed to.
00 21 * * 1-5 /usr/local/bin/test_script.sh >> /var/log/userdirectory/test_script.log 2>&1
Any ideas why?
Well, the most likely case is that something went wrong when you were updating crontab. If you can't track down the specific issue, there's an easy workaround: in test_script.sh, add a couple of lines to quit if it's not one of the correct days for running the script. Something like:
(yes, I know there's better ways to do those statements; this is just a way to do it that is really easy to understand and see what it's doing)