Other crontab syntax error

Hi,

I am trying to run a cronjob to get a zfs snapshot monthly and I get the following error message:
Code:
/bin/sh: Syntax error: end of file unexpected (expecting ")")
/bin/sh: Syntax error: Error in command substitution

Here is my crontab -l
Code:
# Automated ZFS backups monthly (last day of the month)
59   23 28-31 *    *   [ $(date -d +1day +%d) -eq 1 ] && /usr/local/bin/bash /root/myScripts/zfs-snapshot.sh zroot monthly 13

Can anyone please help me figure out the obvious error?

Thank you
 
The date command appears to be the culprit, what are you trying to do with it anyway?
 
SirDice
I am trying to tell it to run the script on the last day of the month.
Taking into account February month.
So the idea is to check if the next day is the 1st so it can decide if the today is the last day of the current month.
Hope this is clearer
 
Back
Top