Hi,
I have a script that runs every night and basically does the following (with some logging around it and some checks to see, if some older snapshots exist)
The backup works, if I trigger the script manually.
But when I call the script as cronjob, it fails every now and then with the following error during the send/recv
Afterwards I have to recreate the backup from scratch.
This only ever happens when I call the script from a cronjob. I have manually done my backups for over a month now just by opening a tmux session and calling the script to verify that everything works. I even tried running the script in a detached screen session like so
This also works when done manually but fails with the above error as cronjob.
Is there anything I have to do differently to have a zfs send/recv work as cronjob or is this a bug?
Regards,
Stefan
I have a script that runs every night and basically does the following (with some logging around it and some checks to see, if some older snapshots exist)
Code:
zfs snapshot -r $snapshot_today
zfs send -R -i $snapshot_yesterday $snapshot_today | zfs recv -Fdu $destination
But when I call the script as cronjob, it fails every now and then with the following error during the send/recv
Code:
Assertion failed: (0 == nvlist_lookup_nvlist(snapprops, thissnap, &snapprops)), file /usr/src/cddl/lib/libzfs/../../../cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c, line 1237.
cannot receive: failed to read from stream
Abort trap (core dumped)
This only ever happens when I call the script from a cronjob. I have manually done my backups for over a month now just by opening a tmux session and calling the script to verify that everything works. I even tried running the script in a detached screen session like so
Code:
/usr/local/bin/screen -d -Logfile /var/log/zfs_backup.log -L -m /usr/local/bin/system_backup.sh
Is there anything I have to do differently to have a zfs send/recv work as cronjob or is this a bug?
Regards,
Stefan