mirror of
https://github.com/phfroidmont/self-hosting.git
synced 2025-12-25 05:36:59 +01:00
17 lines
335 B
Bash
Executable file
17 lines
335 B
Bash
Executable file
#!/bin/bash
|
|
|
|
set -e
|
|
|
|
ONGOING_FILE="/backups/backup-ongoing"
|
|
|
|
if [ -f "$ONGOING_FILE" ]
|
|
then
|
|
if test `find "$ONGOING_FILE" -mmin +180`
|
|
then
|
|
LAST_MODIFICATION_HOURS=`expr "$(($(date +%s) - $(date +%s -r $ONGOING_FILE)))" / 3600`
|
|
echo "Backup not finished after more than $LAST_MODIFICATION_HOURS hours"
|
|
exit 1
|
|
fi
|
|
fi
|
|
|
|
exit 0
|