I am running NS7.5. I have some huge share that change rarely or, at least, in very low percentage (let’s say 99% of files are exactly the same from ages).
I have excluded it from the duplicity backup and I would like to append a rsync that syncs the ibay folder in the same samba share as the duplicity backup (let’s say if myserver is the normal backup, myserver_ibay should be synced) and possibly add a line to the backup log if something goes wrong in rsync.
Actually this simple bash script does the job, but it would be great to append the sync to normal backup:
Thanks for pointing this out, I will check if my NAS supports NFS.
Can you just point me to the docs on new Rsync backup? I couldn’t find it in the options.
May I just some more noobish question (I am really newbie and I don’t want to mess up things in the official test post).
I tried to set up a backup for 3:00pm to test it. And nothing happened. This is config show:
You can look at /var/log/messages, and also some other logs under /var/log with name containing backup (i.e. /var/log/last-backup.log, /var/log/backup-data.log), if any.
Thanks all for your help: I really appreciated and learnt a lot.
Unfortunately I discovered my (cheap) NAS has no sftp support and very poor NFS support. So I go back to the original question.
How can I append the sh script above to the backup process or, at least, schedule it through the template system?
From the top of my head I think you could add an action for the post-backup-data event.
Put your script in /etc/e-smith/events/actions/ with executable permission. Give it a descriptive name.
Then link the action to the post-backup-data event:
cd /etc/e-smith/events/post-backup-data/
ln -s ../actions/yourscriptname S90yourscriptname
Replacing yourscriptname as appropriate.
Haven’t tested this but think it will work (unless you find a permission issue).
What happens if your script prints the log to stdout when the backup is called through backup-data-wrapper?
You may try to append the outcome of rsync to the log generated by backup-data. Take a look at logs and wrapper section of the manual, and the hooks.
Another option would be to call mail or sendmail command from your script to send the log report in a new e-mail message (so not in the same e-mail message you use to get):
Don’t know, you can try with -q (or --quiet) option to suppress non-error messages.
A more drastic option would be to force the exit code (exit 0) of your script.
#dnutan (Marc) #From the top of my head I think you could add an action for the post-backup-data event. #Put your script in /etc/e-smith/events/actions/ with executable permission. Give it a descriptive name. #Then link the action to the post-backup-data event: #cd /etc/e-smith/events/post-backup-data/ #ln -s …/actions/ibay-rsync-mnt-backup S79ibay-rsync-mnt-backup #Haven’t tested this but think it will work (unless you find a permission issue).