changed the healthcheck
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
74
restic.sh
74
restic.sh
@@ -1,38 +1,38 @@
|
||||
#!/bin/ash
|
||||
: "${RESTIC_REPOSITORY:?Need the restic repository}"
|
||||
: "${AWS_ACCESS_KEY_ID:?Need the access key id}"
|
||||
: "${AWS_SECRET_ACCESS_KEY:?Need the secret access key}"
|
||||
: "${RESTIC_PASSWORD:?Need the restic password}"
|
||||
: "${LOG_PATH:-./restic-backup.log}"
|
||||
: "${seafile_data_local:-/seafile}"
|
||||
|
||||
# need to securely provide password: https://restic.readthedocs.io/en/latest/faq.html#how-can-i-specify-encryption-passwords-automatically
|
||||
restic snapshots > /dev/null || restic init
|
||||
|
||||
#Define a timestamp function
|
||||
timestamp() {
|
||||
date "+%b %d %Y %T %Z"
|
||||
}
|
||||
|
||||
# insert timestamp into log
|
||||
printf "\n\n"
|
||||
echo "-------------------------------------------------------------------------------" | tee -a $LOG_PATH
|
||||
echo "$(timestamp): restic-backup.sh started" | tee -a $LOG_PATH
|
||||
|
||||
# Run Backups
|
||||
restic backup $seafile_data_local | tee -a $LOG_PATH
|
||||
|
||||
# Remove snapshots according to policy
|
||||
# If run cron more frequently, might add --keep-hourly 24
|
||||
restic forget --keep-daily 7 --keep-weekly 4 --keep-monthly 12 --keep-yearly 7 | tee -a $LOG_PATH
|
||||
|
||||
# Remove unneeded data from the repository
|
||||
restic prune | tee -a $LOG_PATH
|
||||
|
||||
# Check the repository for errors
|
||||
restic check | tee -a $LOG_PATH
|
||||
|
||||
# insert timestamp into log
|
||||
printf "\n\n"
|
||||
echo "-------------------------------------------------------------------------------" | tee -a $LOG_PATH
|
||||
#!/bin/ash
|
||||
: "${RESTIC_REPOSITORY:?Need the restic repository}"
|
||||
: "${AWS_ACCESS_KEY_ID:?Need the access key id}"
|
||||
: "${AWS_SECRET_ACCESS_KEY:?Need the secret access key}"
|
||||
: "${RESTIC_PASSWORD:?Need the restic password}"
|
||||
: "${LOG_PATH:-./restic-backup.log}"
|
||||
: "${seafile_data_local:-/seafile}"
|
||||
|
||||
# need to securely provide password: https://restic.readthedocs.io/en/latest/faq.html#how-can-i-specify-encryption-passwords-automatically
|
||||
restic snapshots > /dev/null || restic init
|
||||
|
||||
#Define a timestamp function
|
||||
timestamp() {
|
||||
date "+%b %d %Y %T %Z"
|
||||
}
|
||||
|
||||
# insert timestamp into log
|
||||
printf "\n\n"
|
||||
echo "-------------------------------------------------------------------------------" | tee -a $LOG_PATH
|
||||
echo "$(timestamp): restic-backup.sh started" | tee -a $LOG_PATH
|
||||
|
||||
# Run Backups
|
||||
restic backup $seafile_data_local | tee -a $LOG_PATH
|
||||
|
||||
# Remove snapshots according to policy
|
||||
# If run cron more frequently, might add --keep-hourly 24
|
||||
restic forget --keep-daily 7 --keep-weekly 4 --keep-monthly 12 --keep-yearly 7 | tee -a $LOG_PATH
|
||||
|
||||
# Remove unneeded data from the repository
|
||||
restic prune | tee -a $LOG_PATH
|
||||
|
||||
# Check the repository for errors
|
||||
restic check | tee -a $LOG_PATH
|
||||
|
||||
# insert timestamp into log
|
||||
printf "\n\n"
|
||||
echo "-------------------------------------------------------------------------------" | tee -a $LOG_PATH
|
||||
echo "$(timestamp): restic-backup.sh finished" | tee -a $LOG_PATH
|
||||
Reference in New Issue
Block a user