Skip to content

Instantly share code, notes, and snippets.

View MatthewVance's full-sized avatar

Matthew Vance MatthewVance

View GitHub Profile
@MatthewVance
MatthewVance / restic-backup-weekly.sh
Created May 18, 2019 19:56
Script to backup a Raspberry Pi weekly to a Restic over the network via REST.
#!/bin/bash
#: Title : restic
#: Date : October 13, 2018
#: Author : Matt Vance
#: Version : 1.0
#: Description : Script to run regular restic backups
#: License : MIT License (MIT)
# Copyright (C) 2018 Matthew Vance
@MatthewVance
MatthewVance / restic-backup-daily.sh
Created May 18, 2019 19:49
Restic daily and hourly backup scripts with systemd timers.
#!/bin/bash
#: Title : restic
#: Date : July 15 2018
#: Author : Matt Vance
#: Version : 1.1
#: Description : Script to fully sytem backlup
#: License : MIT License (MIT)
# Copyright (C) 2019 Matthew Vance
@MatthewVance
MatthewVance / restic-init.sh
Created May 18, 2019 15:13
Example bash shell script to initialize a new Restic repo.
#!/bin/bash
#: Title : restic-init-local
#: Date : July 16 2018
#: Author : Matt Vance
#: Version : 1.0
#: Description : Script to create local restic repo
#: License : MIT License (MIT)
# Copyright (C) 2018 Matthew Vance
@MatthewVance
MatthewVance / restic-snapshots.sh
Created May 18, 2019 15:12
Example bash shell script to return a list of Restic snapshots.
#!/bin/bash
#: Title : restic
#: Date : July 22 2018
#: Author : Matt Vance
#: Version : 1.0
#: Description : Script to fully sytem backlup
#: License : MIT License (MIT)
# Copyright (C) 2018 Matthew Vance
@MatthewVance
MatthewVance / restic-aws-daily.service
Created May 18, 2019 15:08
Example script and systemd scheduled service to sync local repo to AWS S3. This is if you prefer to backup locally on your network and sync a copy to S3 rather than use Restic to automatically interface with a S3 based repo.
[Unit]
Description=Runs daily aws sync script
[Service]
Type=oneshot
ExecStart=/etc/restic/aws.sh
@MatthewVance
MatthewVance / restic-exclude-file-linux
Created May 18, 2019 15:04
Restic backup exclude file example for Linux.
/dev/*
/home/*/.bash_history
/home/*/.cache/chromium
/home/*/.local/share/Trash
/home/*/.mozilla/firefox/*/Cache
/home/*/Documents/Exclude/*
/lib/modules/*/volatile/.mounted
/media/*
/mnt/*
/proc/*
@MatthewVance
MatthewVance / restic-daily-maintenance.service
Created May 18, 2019 15:00
Restic backup maintenance script, scheduled with a systemd timer rather than cron job.
[Unit]
Description=Runs daily restic maintenance script
[Service]
Type=oneshot
ExecStart=/etc/restic/restic-maintenance-daily.sh
User=restic
@MatthewVance
MatthewVance / bash_aliases
Created April 7, 2019 02:24
Bash Aliases
#########
# Aliases
#########
# Configure aliases to work when prefixed with sudo
alias sudo='sudo '
# ------------------------------------
# Apt-get
# ------------------------------------
# Install package (e.g., apti nginx)
@MatthewVance
MatthewVance / caddy.service
Created July 11, 2018 02:46
Caddy Systemd service
[Unit]
Description=Caddy HTTP/2 web server
Documentation=https://caddyserver.com/docs
After=network-online.target
Wants=network-online.target systemd-networkd-wait-online.service
[Service]
Restart=on-abnormal
; User and group the process will run as.
@MatthewVance
MatthewVance / rclone.service
Created July 11, 2018 02:45
Rclone Systemd service
[Unit]
Description=rclone - rsync for cloud storage
Documentation=https://rclone.org/docs/
After=network-online.target
Before=caddy.service
Wants=network-online.target systemd-networkd-wait-online.service
Requires=caddy.service
[Service]
Restart=on-abnormal