1

My /etc/crontab contains the following lines:

0      *       *       *       *       root    /usr/bin/touch /root/IT_WORKED
1      *       *       *       *       root    /bin/sh -c '/sbin/zfs snap -r zpool@snapped_$(/bin/date '+%Y.%m.%d-%H.%M.%S-%Z-A') '
2      *       *       *       *       root    /bin/sh -c "/sbin/zfs snap -r zpool@snapped_`/bin/date '+%Y.%m.%d-%H.%M.%S-%Z_B'` "

When it's left to run, I see that the touched file is updated, so cron is clearly picking up the file on the hour. But the zfs snapshots aren't created. I've tested the 2nd and 3rd lines in shell and they both work fine as CLI commands, and snapshots are created.

So why aren't they running from cron?

Stilez
  • 1,261

0 Answers0