Open HWesterhof opened 2 years ago
/root/.bashrc has no effect on crontabs. cron typically ignores user environment, and that includes the root "user".
There are multiple possible ways to properly set things like PATH for cron environment. It depends on the OS. One of the more common ones, is actually to just put
PATH=/what/you/want
at the top of the crontab file. Please read the docs for your OS for more details.
On Sat, Apr 2, 2022 at 10:42 AM HWesterhof @.***> wrote:
I used the script from here: https://github.com/bolthole/zrep/blob/zrep2/zrep
When run from SSH shell, no issues here:
@.:~# pwd /root @.:~# whoami root @.:~# /usr/sbin/zrep -S zfs-ssd/subvol-100-disk-0 sending @._000004 to localhost:zfs-hd/subvol-100-disk-0 Expiring zrep snaps on zfs-ssd/subvol-100-disk-0 Also running expire on localhost:zfs-hd/subvol-100-disk-0 now... Expiring zrep snaps on zfs-hd/subvol-100-disk-0
But when I try using a cronjob:
0 /12 /usr/sbin/zrep -S zfs-ssd/subvol-100-disk-0
WARNING: old ZFS version detected with no depth protection WARNING: You may not nest zrep managed filesystems /usr/sbin/zrep: line 1999: zfs: command not found Error: zfs-ssd/subvol-100-disk-0 not master. Cannot sync
More info:
@.***:~# cat /etc/debian_version 11.1
@.***:~# bash --version bash --version GNU bash, version 5.1.4(1)-release (x86_64-pc-linux-gnu)
Also added this line to my /root/.bashrc file, with no effect:
export PATH="/usr/sbin:$PATH"
— Reply to this email directly, view it on GitHub https://github.com/bolthole/zrep/issues/190, or unsubscribe https://github.com/notifications/unsubscribe-auth/AANEV6PUUUAHCWMQ4O7TUKTVDCBJBANCNFSM5SLHBAQA . You are receiving this because you are subscribed to this thread.Message ID: @.***>
I used the script from here: https://github.com/bolthole/zrep/blob/zrep2/zrep
When run from SSH shell, no issues here:
But when I try using a cronjob:
0 */12 * * * /usr/sbin/zrep -S zfs-ssd/subvol-100-disk-0
More info:
Also added this line to my /root/.bashrc file, with no effect:
export PATH="/usr/sbin:$PATH"