I apologize in advance if this is inartfully asked...
I have a zpool on one machine that I want to backup to another - both are running FreeBSD 13 w/OpenZFS. I would like to run the backup every night, automatically. Currently, I run the following script:
~/backup-scm.sh
#!/usr/local/bin/bash -x
sudo zfs snapshot zfs/scm@snap1
sudo zfs send zfs/scm@snap1 | ssh destination sudo zfs recv -F zroot/backup/scm
ssh destination sudo zfs destroy zroot/backup/scm@snap1
sudo zfs destroy zfs/scm@snap1
I run the script as my normal user cuz it works . But, I am looking to automate the process and run it either as a periodic or in a crontab. By way of background, every time I try to put it in crontab, I run into permission issues or path issues or whatnot. I'm curious as to what the current best practice is and how it works.
I have a zpool on one machine that I want to backup to another - both are running FreeBSD 13 w/OpenZFS. I would like to run the backup every night, automatically. Currently, I run the following script:
~/backup-scm.sh
#!/usr/local/bin/bash -x
sudo zfs snapshot zfs/scm@snap1
sudo zfs send zfs/scm@snap1 | ssh destination sudo zfs recv -F zroot/backup/scm
ssh destination sudo zfs destroy zroot/backup/scm@snap1
sudo zfs destroy zfs/scm@snap1
I run the script as my normal user cuz it works . But, I am looking to automate the process and run it either as a periodic or in a crontab. By way of background, every time I try to put it in crontab, I run into permission issues or path issues or whatnot. I'm curious as to what the current best practice is and how it works.