Success Vs failure of backup

I plan to use Kopia to backup a remote server hosted on Rackspace on a nightly basis.

Depending on the outcome of the backup… successful v unsuccessful I would like to send myself an email telling me of the result so that I can monitor without logging in to the server.

Is this possible and are there any instructions if it is?

Thanks in advance for your help.

If you use kopia in crontab (like I do), you can use commands similar to this:

# verify backups every hour
40 * * * * /usr/bin/kopia content verify --log-level=warning

# create snapshots twice an hour
22,43 * * * * /usr/bin/kopia snapshot create --all --log-level=warning --no-progress

They will produce no output on success and cron will automatically send emails on errors.

Also for kopia server there’s currently no built-in notification mechanism (we’ll probably add it so that Windows users who don’t have crontab can still get notified). For the time being I’d recommend the cron route for situations like yours.

@jkowalski thanks very much for your help. I hadn’t thought of using cron’s emailing function itself.

@jkowalski on further thought I would like an email sent to myself even when the snapshot and verify run successfully. I was therefore thinking of doing something along the following lines.

Using your crontab example commands in a bash shell. Sending any log output to some destination file that has a datestamp as part of the filename. Then checking if the file exists after the verify and create commands have finished running. If it does send an ‘Error’ email otherwise a ‘Success’ email.

My question is: Does changing the log-level to warning have any effect on the output to the logfiles created by kopia in ~/cache/kopia? The documentation seems to suggest that there is a separate default for the logfile output as opposed to STDOUT…but just want to double check.

Also can you think of anything that may generate a STDERR output from the cron commands?

Thanks in advance for your help.