You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
11 months ago | |
---|---|---|
.gitignore | 12 months ago | |
LICENSE | 12 months ago | |
README.md | 12 months ago | |
clone_vmdk.sh | 12 months ago | |
mcapi.sh | 2 years ago | |
request_certificate.sh | 1 year ago | |
restic_backup.sh | 2 years ago | |
switch_desktop.sh | 1 year ago | |
take_snapshot.sh | 1 year ago | |
watch_containers.sh | 11 months ago |
README.md
scripts
My personal collection of handy scripts. mostly bash.
restic_backup.sh
This script is my very simple take on how to perform restic backups.
First you need to download the script from this Git repository. I usually just put it in root's home.
# Download
sudo curl -o /root/restic_backup.sh https://git.socialnerds.org/david/scripts/raw/branch/main/restic_backup.sh
sudo chmod +x /root/restic_backup.sh
In the config section at the top of the script you can change various options to your liking.
# **** CONFIG ****
PASSWORD="/root/.restic-password"
REPO="sftp:<remote-server>:/path/to/repository"
KEEP=30
BIN="/usr/bin/restic"
OPTIONS="-p $PASSWORD -r $REPO -q"
You can run restic_backup.sh
directly from the command line
# Usage
/root/restic_backup.sh /local/path <additional flags for the backup subcommand>
# Example
/root/restic_backup.sh /home -x -e ./.snapshots
or using cron.
# Cronjob
47 0 * * * /root/restic_backup.sh /home
# Cronjob (with healthchecks notification)
47 0 * * * /root/restic_backup.sh /home && curl -fsS -m 10 --retry 5 -o /dev/null https://checks.socialnerds.org/ping/fb721aec-5179-42c3-3455-4fd2ff39ii55
Happy backuping! :-)