zfsonlinux / zfs-auto-snapshot

ZFS Automatic Snapshot Service for Linux
GNU General Public License v2.0
848 stars 244 forks source link

Default install puts zfs-auto-snapshot.sh in unfindable directory. #47

Open jgilmore opened 9 years ago

jgilmore commented 9 years ago

The script is by default placed in /usr/local/sbin, which is not included in the path specified in the included crontab files.

From /etc/cron.d/zfs-auto-snapshot:

PATH="/usr/bin:/bin:/usr/sbin:/sbin"

Either the default install location needs to be changed, or /usr/local/sbin needs to be included in that path...

didyouexpectthat commented 9 years ago

I just found this as well. Getting e-mails from my server.

From: root@dirty.rotten.soy (Cron Daemon) To: root@dirty.rotten.soy Subject: Cron root@dirty zfs-auto-snapshot -q -g --label=frequent --keep=4 // Content-Type: text/plain; charset=UTF-8 X-Cron-Env: X-Cron-Env: X-Cron-Env: X-Cron-Env: Message-Id: 20150607151501.3780A96173@dirty.rotten.soy Date: Sun, 7 Jun 2015 08:15:01 -0700 (PDT)

/bin/sh: 1: zfs-auto-snapshot: not found


root@dirty:/etc/cron.d# cat zfs-auto-snapshot PATH="/usr/bin:/bin:/usr/sbin:/sbin"

/15 * * * \ root zfs-auto-snapshot -q -g --label=frequent --keep=4 //

root@dirty:/etc/cron.d# whereis zfs-auto-snapshot zfs-auto-snapshot: /usr/local/sbin/zfs-auto-snapshot

jgilmore commented 9 years ago

Yep, that's the one. My workaround was: cd /usr/sbin sudo ln -s /usr/local/sbin/zfs-auto-snapshot .

Either the link becomes redundant or is overwritten, either way it's harmless.

vozhyk- commented 8 years ago

Another workaround is installing with

make install PREFIX=/usr
scottlinux commented 8 years ago

https://github.com/zfsonlinux/zfs-auto-snapshot/pull/48 https://github.com/zfsonlinux/zfs-auto-snapshot/pull/44