Compare commits
No commits in common. "bafd045a5f0217b5624e450b810263121845bb4c" and "fb982cd6462d027c6ab5a28ef0a3091c460031e5" have entirely different histories.
bafd045a5f
...
fb982cd646
|
|
@ -2,10 +2,6 @@
|
||||||
|
|
||||||
. /etc/backup.conf
|
. /etc/backup.conf
|
||||||
|
|
||||||
if [ -n "$HEALTHCHECK_URL" ]; then
|
|
||||||
curl -L "{$HEALTHCHECK_URL}/start"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# some helpers and error handling:
|
# some helpers and error handling:
|
||||||
info() { printf "\n%s %s\n\n" "$( date )" "$*" >&2; }
|
info() { printf "\n%s %s\n\n" "$( date )" "$*" >&2; }
|
||||||
trap 'echo $( date ) Backup interrupted >&2; exit 2' INT TERM
|
trap 'echo $( date ) Backup interrupted >&2; exit 2' INT TERM
|
||||||
|
|
@ -67,8 +63,4 @@ else
|
||||||
info "Backup, Prune, and/or Compact finished with errors"
|
info "Backup, Prune, and/or Compact finished with errors"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -n "$HEALTHCHECK_URL" ]; then
|
|
||||||
curl -L "{$HEALTHCHECK_URL}/{$global_exit}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
exit ${global_exit}
|
exit ${global_exit}
|
||||||
|
|
@ -19,12 +19,9 @@ assert getpass.getpass("Confirm passhphrase: ").rstrip() == secret_seed, "Passph
|
||||||
salted_secret_seed = hostname + secret_seed
|
salted_secret_seed = hostname + secret_seed
|
||||||
salted_hash_value = hashlib.sha512(salted_secret_seed.encode())
|
salted_hash_value = hashlib.sha512(salted_secret_seed.encode())
|
||||||
|
|
||||||
healthcheck_url = input("Enter healthcheck url: ").rstrip()
|
|
||||||
|
|
||||||
with open("/etc/backup.conf", "w") as f:
|
with open("/etc/backup.conf", "w") as f:
|
||||||
f.write(f"export BORG_REPO='ssh://{hostname}@{server_hostname}.162536.xyz:22/~/backup/docker'\n")
|
f.write(f"export BORG_REPO='ssh://{hostname}@{server_hostname}.162536.xyz:22/~/backup/docker'\n")
|
||||||
f.write(f"export BORG_PASSPHRASE='{salted_hash_value.hexdigest()}'\n")
|
f.write(f"export BORG_PASSPHRASE='{salted_hash_value.hexdigest()}'\n")
|
||||||
f.write(f"export HEALTHCHECK_URL='{healthcheck_url}'\n")
|
|
||||||
|
|
||||||
os.system("ssh-keygen -t rsa -q -f \"$HOME/.ssh/id_rsa\" -N \"\"")
|
os.system("ssh-keygen -t rsa -q -f \"$HOME/.ssh/id_rsa\" -N \"\"")
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +0,0 @@
|
||||||
# Backups
|
|
||||||
|
|
||||||
Example cron:
|
|
||||||
```sh
|
|
||||||
32 * * * * /bin/sh /root/standard-build/backup/backup-script.sh >/root/last-backup-log.txt 2>&1
|
|
||||||
```
|
|
||||||
Loading…
Reference in New Issue