Skip to content

Commit

Permalink
Merge changes from erikw#19
Browse files Browse the repository at this point in the history
  • Loading branch information
toddejohnson committed Jul 13, 2019
2 parents ea133c8 + a489e44 commit c065dc0
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 9 deletions.
10 changes: 2 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
@@ -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


Expand All @@ -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.
Expand All @@ -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)
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion usr/local/sbin/restic_backup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ RETENTION_YEARS=3
# What to backup, and what to not
BACKUP_PATHS="/ /boot /home"
[ -d /mnt/media ] && BACKUP_PATHS+=" /mnt/media"
BACKUP_EXCLUDES="--exclude-file /.backup_exclude"
BACKUP_EXCLUDES="--exclude-file /etc/restic/backup_exclude"
for dir in /home/*
do
if [ -f "$dir/.backup_exclude" ]
Expand Down

0 comments on commit c065dc0

Please sign in to comment.