I noticed a strange behavior with one of the daily cron, "single-liners" i got running for past several months:
Code: Select all
EVENODD="$([ $(($(date +%d)%2)) -eq 0 ] && echo "EVEN" || echo "ODD")"
tar czf /root/etc.backup.daily$EVENODD.tar.gz /etc &> /tmp/etc.backup.daily$EVENODD.log
Code: Select all
-rw-r--r-- 1 root root 1244662 Mar 6 02:55 etc.backup.dailyEVEN.tar.gz
-rw-r--r-- 1 root root 1244665 Mar 7 02:55 etc.backup.dailyODD.tar.gz
Code: Select all
08: value too great for base (error token is "08")
Code: Select all
$ echo $(($(date +%d)%2))
The script has not been modified for a while... if it would fail earlier, the result tars would not get created as shown, unless I am going crazy...
Thanks,
Mike