I have a bash script used for workstation backups that runs via cron (one entry per workstation). The script does some tasks (wake on lan to wake the machine, etc) as well as managing and filtering logs from the rsync process. After updating to FreeNAS
But for testing, I've whittled the script down to simply:
When I run the script from the shell it works fine.
When the script runs via cron, via "Run Now" from the web interface, or via
I'm currently banging my head against the wall; I can't figure out what's different between the two cases.
Probably I should re-work this to tunnel everything over ssh (it's rather absurd that I'm not doing that already), but does anyone have any idea why it's failing in the cron environment or have suggestions on how to troubleshoot this?
But for testing, I've whittled the script down to simply:
Code:
#!/usr/local/bin/bash /usr/local/bin/rsync -a --password-file=/mnt/tank/sekrets/rsync.secret --force --ignore-errors machine-name::etc /mnt/tank/backup/machine-name/current/etc -v --numeric-ids --dry-run
When I run the script from the shell it works fine.
When the script runs via cron, via "Run Now" from the web interface, or via
/usr/local/bin/midclt call cronjob.run 8
, rsync fails withCode:
@ERROR: auth failed on module etc rsync error: error starting client-server protocol (code 5) at main.c(1671) [Receiver=3.1.3]
I'm currently banging my head against the wall; I can't figure out what's different between the two cases.
Probably I should re-work this to tunnel everything over ssh (it's rather absurd that I'm not doing that already), but does anyone have any idea why it's failing in the cron environment or have suggestions on how to troubleshoot this?
Last edited: