22 lines
516 B
Bash
22 lines
516 B
Bash
#!/bin/sh
|
|
|
|
start=`date +%s`
|
|
echo "Starting Check at $(date +"%Y-%m-%d %H:%M:%S")"
|
|
echo "RESTIC_REPOSITORY: ${RESTIC_REPOSITORY}"
|
|
echo "CHECK_CRON: ${CHECK_CRON}"
|
|
echo "RESTIC_CHECK_ARGS: ${RESTIC_CHECK_ARGS}"
|
|
|
|
restic check ${RESTIC_CHECK_ARGS}
|
|
rc=$?
|
|
echo "Finished check at $(date)"
|
|
if [[ $rc == 0 ]]; then
|
|
echo "Backup Successful"
|
|
else
|
|
echo "Backup Failed with status ${rc}"
|
|
restic unlock
|
|
kill 1
|
|
fi
|
|
|
|
end=`date +%s`
|
|
echo "Finished check at $(date +"%Y-%m-%d %H:%M:%S") after $((end-start)) seconds"
|