I'm having an issue with znapzend --runonce I am running Debian Wheezy I'm running from cron as I need to stagger my snapshots I have the following in my crontab

PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/znapzend/lib/ZnapZend:/opt/znapzend/bin
ZNAPZENDCMD="/opt/znapzend/bin/znapzend --logto=/var/log/znapzend.log --runonce"
03  *  *  *  *  root ${ZNAPZENDCMD}=STORAGE/administration

The issue I'm having is that my remote DST is failing yet the local snapshot works fine. The DST does exist but reports that it doesn't but only when run from cron If I run from a normal root shell all is fine so I suspect it is a PATH issue?

here is a snippet from the log:

[Tue Apr 28 15:03:01 2015] [info] refreshing backup plans...
[Tue Apr 28 15:03:02 2015] [warn] destination 'witbackup01:OFFSITE/ah/ahserver/administration' does not exist. ignoring it...
[Tue Apr 28 15:03:02 2015] [info] found a valid backup plan for STORAGE/administration...
[Tue Apr 28 15:03:02 2015] [debug] snapshot worker for STORAGE/administration spawned (5592)
[Tue Apr 28 15:03:02 2015] [info] creating recursive snapshot on STORAGE/administration
[Tue Apr 28 15:03:02 2015] [debug] snapshot worker for STORAGE/administration done (5592)
[Tue Apr 28 15:03:02 2015] [debug] send/receive worker for STORAGE/administration spawned (5596)
[Tue Apr 28 15:03:02 2015] [info] starting work on backupSet STORAGE/administration
[Tue Apr 28 15:03:02 2015] [debug] sending snapshots from STORAGE/administration to BACKUPS/ahserver/administration
[Tue Apr 28 15:03:03 2015] [debug] cleaning up snapshots on BACKUPS/ahserver/administration
[Tue Apr 28 15:03:04 2015] [debug] cleaning up snapshots on STORAGE/administration
[Tue Apr 28 15:03:04 2015] [info] done with backupset STORAGE/administration in 2 seconds
[Tue Apr 28 15:03:04 2015] [debug] send/receive worker for STORAGE/administration done (5596)

and here is my znapzendsetup for this datasource

*** backup plan: STORAGE/administration ***
dst_offsite     = witbackup01:OFFSITE/ah/ahserver/administration
dst_offsite_plan= 7days=>1day
dst_onsite      = BACKUPS/ahserver/administration
dst_onsite_plan = 30days=>1day,3months=>1month
enabled         = on
mbuffer         = off
mbuffer_size    = 512M
post_znap_cmd   = off
pre_znap_cmd    = off
recursive       = on
src             = STORAGE/administration
src_plan        = 24hours=>1hour,30days=>1day,3months=>1month
tsformat        = %Y-%m-%d-%H%M%S

Any suggestions?

My guess is that the environment when running from cron and when running on the commandline is not equivalent. Maybe ssh does not get todo a password free remote login.

On another note, you may want to use something like sleep 60 as a pre-snap-command to stagger your snapshots.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.