btrfs won't run from cron

Posted by Mikkel on Super User See other posts from Super User or by Mikkel
Published on 2014-08-16T03:05:39Z Indexed on 2014/08/20 16:25 UTC
Read the original article Hit count: 224

Filed under:
|
|

I'm trying to set up a cron job to create a btrfs subvolume snapshot of my root partition. The command works perfectly if I run it from the command line, but nothing happens at the scheduled cron time. I've tried piping to logger and redirecting stdout/stderr to file, and not only is there no content, the file I'm logging to isn't even created.

The cron command I have is as follows:

0 0 * * * /sbin/btrfs subvolume snapshot / "/snapshots/$(date +%Y-%m-%d)"

I've tried prefixing it with /bin/bash, but that makes no difference. What am I missing?

© Super User or respective owner

Related posts about linux

Related posts about cron