hacks/homedir.makefile/Makefile

62 lines
1.7 KiB
Makefile
Raw Normal View History

2012-06-20 08:22:58 +00:00
JUNKFILES = .bash_history .irb_history .pip .ScanSnap .nbems .fldigi .cpan
JUNKFILES += .gdb_history .mysql_history .sqlite_history
2012-12-19 00:17:00 +00:00
YYYYMM := $(shell date +%Y%m)
2012-06-20 08:22:58 +00:00
2013-02-28 16:38:06 +00:00
NO_COLOR = \033[0m
O1_COLOR = \033[0;01m
O2_COLOR = \033[32;01m
PREFIX = "$(O2_COLOR)==>$(O1_COLOR)"
SUFFIX = "$(NO_COLOR)"
2012-06-20 08:22:58 +00:00
default: backup
2013-03-03 22:29:23 +00:00
backup: clean mailoffsite databackup
dvbackup:
2013-02-28 16:38:06 +00:00
@echo $(PREFIX) $@ $(SUFFIX)
cd ~/Documents/datavibe/backup && make
2013-03-03 22:29:23 +00:00
imapbackup:
2013-02-28 16:38:06 +00:00
offlineimap
rsync -e "ssh -c arcfour -o Compression=no -x" \
-avPhzy --delete sneak@datavibe.net:.maildir/ \
$(HOME)/Documents/Archival/mail/sneak.datavibe.net.maildir/
2013-03-03 22:29:23 +00:00
mailoffsite: imapbackup
2013-02-28 16:38:06 +00:00
rsync -e "ssh -c arcfour -o Compression=no -x" \
-avPhzy --delete $(HOME)/Documents/Archival/mail/ \
sneak@datavibe.net:.mailbackup/
2013-03-03 22:29:23 +00:00
databackup: dvbackup imapbackup
2013-02-28 16:38:06 +00:00
backup.command
2012-06-20 08:22:58 +00:00
2013-03-27 07:32:34 +00:00
cleanup:
-mkdir -p $(HOME)/Documents/$(YYYYMM)
-mv $(HOME)/Desktop/* $(HOME)/Documents/$(YYYYMM)
clean: cleanup
2013-02-28 16:38:06 +00:00
@echo $(PREFIX) $@ $(SUFFIX)
2013-05-14 22:24:10 +00:00
@-rm -rf ~/.tmp/*
2013-02-28 16:38:06 +00:00
@-rm -rf ~/Library/Caches/*
@-rm -rf ~/.Trash/*
@-rm -rf $(JUNKFILES)
2012-06-20 08:22:58 +00:00
size:
du -sh $(HOME)
2013-05-14 22:24:10 +00:00
lifeboat:
mkdir -p $(HOME)/tmp/lifeboat.$(YYYYMM)
rsync -avP --exclude='*.pkg' $(HOME)/.ssh/ $(HOME)/tmp/lifeboat.$(YYYYMM)/sshkey/
rsync -avP --exclude='*.pkg' $(HOME)/.gnupg/ $(HOME)/tmp/lifeboat.$(YYYYMM)/gnupgkeys/
rsync -avP $(HOME)/Library/ApplicationSupport/Bitcoin/wallet.dat \
$(HOME)/tmp/lifeboat.$(YYYYMM)/wallet.dat
tar -c $(HOME)/tmp/lifeboat.$(YYYYMM) | bzip2 | \
gpg --symmetric -a -o $(HOME)/lifeboat.$(YYYYMM).gpg
rm -rf $(HOME)/tmp/lifeboat.$(YYYYMM)
verify:
duplicity verify --exclude-globbing-filelist \
$(HOME)/.local/etc/duplicity.exclude \
file:///Volumes/EXTUSB01/dup/ ~