Merge branch 'master' into 16-metered-net
This commit is contained in:
10
Makefile
10
Makefile
@@ -1,17 +1,15 @@
|
||||
# Not file targets.
|
||||
.PHONY: help install install-scripts install-conf install-exclude install-systemd
|
||||
.PHONY: help install install-scripts install-conf install-systemd
|
||||
|
||||
### Macros ###
|
||||
SRCS_SCRIPTS = $(filter-out %cron_mail, $(wildcard usr/local/sbin/*))
|
||||
SRCS_CONF = $(filter-out %template, $(wildcard etc/restic/*))
|
||||
SRCS_EXCLUDE = .backup_exclude
|
||||
SRCS_SYSTEMD = $(wildcard etc/systemd/system/*)
|
||||
|
||||
# Just set PREFIX in envionment, like
|
||||
# $ PREFIX=/tmp/test make
|
||||
DEST_SCRIPTS = $(PREFIX)/usr/local/sbin
|
||||
DEST_CONF = $(PREFIX)/etc/restic
|
||||
DEST_EXCLUDE = $(PREFIX)/
|
||||
DEST_SYSTEMD = $(PREFIX)/etc/systemd/system
|
||||
|
||||
|
||||
@@ -24,7 +22,7 @@ help:
|
||||
@egrep "#\starget:" [Mm]akefile | sed 's/\s-\s/\t\t\t/' | cut -d " " -f3- | sort -d
|
||||
|
||||
# target: install - Install all files
|
||||
install: install-scripts install-conf install-exclude install-systemd
|
||||
install: install-scripts install-conf install-systemd
|
||||
|
||||
|
||||
# target: install-scripts - Install executables.
|
||||
@@ -44,10 +42,6 @@ install-conf: | etc/restic/b2_env.sh etc/restic/b2_pw.txt
|
||||
install -d $(DEST_CONF)
|
||||
install -m 0600 $(SRCS_CONF) $(DEST_CONF)
|
||||
|
||||
# target: install-exclude - Install backup exclude file.
|
||||
install-exclude:
|
||||
install $(SRCS_EXCLUDE) $(DEST_EXCLUDE)
|
||||
|
||||
# target: install-systemd - Install systemd timer and service files
|
||||
install-systemd:
|
||||
install -d $(DEST_SYSTEMD)
|
||||
|
||||
@@ -22,8 +22,17 @@ RETENTION_MONTHS=18
|
||||
RETENTION_YEARS=3
|
||||
|
||||
# What to backup, and what to not
|
||||
BACKUP_PATHS="/ /boot /home /mnt/media"
|
||||
BACKUP_EXCLUDES="--exclude-file /.backup_exclude --exclude-file /mnt/media/.backup_exclude --exclude-file /home/erikw/.backup_exclude"
|
||||
BACKUP_PATHS="/ /boot /home"
|
||||
[ -d /mnt/media ] && BACKUP_PATHS+=" /mnt/media"
|
||||
BACKUP_EXCLUDES="--exclude-file /etc/restic/backup_exclude"
|
||||
for dir in /home/*
|
||||
do
|
||||
if [ -f "$dir/.backup_exclude" ]
|
||||
then
|
||||
BACKUP_EXCLUDES+=" --exclude-file $dir/.backup_exclude"
|
||||
fi
|
||||
done
|
||||
|
||||
BACKUP_TAG=systemd.timer
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user