Skip to content

Instantly share code, notes, and snippets.

Avatar

Graeme Hay grmhay

View GitHub Profile
@grmhay
grmhay / db_backup.sh
Last active Dec 19, 2019 — forked from bendavis78/db_backup.sh
A simple database backup / rotation / prune script
View db_backup.sh
#!/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 Jul 13, 2019 — forked from seebk/rsync_backup.py
Python rsync backup script
View rsync_backup.py
#!/usr/bin/python3
#######################################################
# Python rsync Backup script
# Sebastian Kraft, 24.06.2013
#
#######################################################
#-----------------------------------------------------
# Config
@grmhay
grmhay / cfg-install
Last active Oct 19, 2018
User environment installation
View cfg-install
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.";
You can’t perform that action at this time.