From 42f5ec2dc8795c36d26f40e5f601738a2b450359 Mon Sep 17 00:00:00 2001 From: alex Date: Wed, 13 Oct 2021 00:21:45 -0400 Subject: [PATCH] backups: Add daily/weekly dump scripts for simple backups As I write this, I'm noticing they're _huge_, so we'll see how long this lasts until I replace it with something else (heck, it feels like tar could do a better job compressing this data...) It was fun to play with this old tool at least :) --- Makefile | 2 ++ etc/daily.local | 10 ++++++++++ etc/weekly.local | 8 ++++++++ 3 files changed, 20 insertions(+) create mode 100644 etc/daily.local create mode 100644 etc/weekly.local diff --git a/Makefile b/Makefile index 60a3569..22b8b74 100644 --- a/Makefile +++ b/Makefile @@ -2,6 +2,8 @@ FILES = /etc/httpd.conf \ /etc/acme-client.conf \ /etc/mail/smtpd.conf \ + /etc/daily.local \ + /etc/weekly.local \ /var/git/stagit-post-receive \ /usr/local/bin/newrepo \ /usr/local/man/man1/newrepo.1 \ diff --git a/etc/daily.local b/etc/daily.local new file mode 100644 index 0000000..3c8b9de --- /dev/null +++ b/etc/daily.local @@ -0,0 +1,10 @@ +ROOTBACKUP=1 + +BAKDIR="/bak/$(date +%F)" +mkdir -p "$BAKDIR" + +dump -1auf "$BAKDIR/root.dump.1" / +dump -1auf "$BAKDIR/home.dump.1" /home +dump -1auf "$BAKDIR/usr.dump.1" /usr +dump -1auf "$BAKDIR/usr-local.dump.1" /usr/local +dump -1auf "$BAKDIR/var.dump.1" /var diff --git a/etc/weekly.local b/etc/weekly.local new file mode 100644 index 0000000..026d0f4 --- /dev/null +++ b/etc/weekly.local @@ -0,0 +1,8 @@ +BAKDIR="/bak/$(date +%F)" +mkdir -p "$BAKDIR" + +dump -0auf "$BAKDIR/root.dump.0" / +dump -0auf "$BAKDIR/home.dump.0" /home +dump -0auf "$BAKDIR/usr.dump.0" /usr +dump -0auf "$BAKDIR/usr-local.dump.0" /usr/local +dump -0auf "$BAKDIR/var.dump.0" /var -- libgit2 1.1.1