1
1
Fork 0
My personal collection of handy scripts. Mostly bash.
Go to file
david e6a87e8357 cleaned up scripts repo, archived old scripts to another repo 2022-04-16 20:24:26 +02:00
.gitignore cleaned up scripts repo, archived old scripts to another repo 2022-04-16 20:24:26 +02:00
LICENSE cleaned up scripts repo, archived old scripts to another repo 2022-04-16 20:24:26 +02:00
README.md Added v0.1 of restic_backups.sh 2021-02-10 19:07:59 +01:00
clone_vmdk.sh cleaned up scripts repo, archived old scripts to another repo 2022-04-16 20:24:26 +02:00
mcapi.sh added mcapi.sh 2021-09-03 13:59:47 +02:00
request_certificate.sh added request_certificate.sh 2021-10-16 21:48:28 +02:00
restic_backup.sh fixed a bug where the password file and repo were given twice 2021-02-20 15:43:10 +01:00
switch_desktop.sh added switch desktop script and edited jekyll.sh 2021-11-20 21:43:25 +01:00
take_snapshot.sh added take_snapshot.sh 2021-10-16 21:12:00 +02:00
watch_containers.sh added watch_containers.sh 2022-01-22 00:24:45 +01:00

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! :-)


setup_zsh.sh

One-line installer for zsh, oh-my-zsh and various zsh plugins.

curl -fsSL https://socialg.it/david/scripts/raw/master/setup_zsh.sh | bash

It is still highly experimental and will probably fail on your system.