Skip to content

Instantly share code, notes, and snippets.

View grmhay's full-sized avatar

Graeme Hay grmhay

View GitHub Profile
@grmhay
grmhay / db_backup.sh
Last active December 19, 2019 03:32 — forked from bendavis78/db_backup.sh
A simple database backup / rotation / prune script
#!/bin/bash
# Forked from gist bendavis78/db_backup.sh
# Added better logging so the script can be monitored
# for use with cron, eg:
# 0 3 * * * postgres /var/db/db_backup.sh foo_db
if [[ -z "$1" ]]; then
echo "Usage: $0 <db_name> [pg_dump args]"
@grmhay
grmhay / rsync_backup.py
Created July 13, 2019 19:05 — forked from seebk/rsync_backup.py
Python rsync backup script
#!/usr/bin/python3
#######################################################
# Python rsync Backup script
# Sebastian Kraft, 24.06.2013
#
#######################################################
#-----------------------------------------------------
# Config
@grmhay
grmhay / cfg-install
Last active October 19, 2018 00:08
User environment installation
git clone --bare https://github.com/grmhay/config.git $HOME/.cfg
function config {
/usr/bin/git --git-dir=$HOME/.cfg/ --work-tree=$HOME $@
}
mkdir -p .config-backup
config checkout
if [ $? = 0 ]; then
echo "Checked out config.";
else
echo "Backing up pre-existing dot files.";