hacks/homedir.makefile/Makefile

73 lines
2.0 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
2013-12-29 02:17:22 +00:00
BREWPACKAGES := mosh duplicity pv offlineimap wget nmap tor torsocks
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" \
2013-08-13 06:42:47 +00:00
-avPhzy --delete-after sneak@datavibe.net:.maildir/ \
2013-02-28 16:38:06 +00:00
$(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" \
2013-08-13 06:42:47 +00:00
-avPhzy --delete-after $(HOME)/Documents/Archival/mail/ \
2013-02-28 16:38:06 +00:00
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)
2013-08-13 06:42:47 +00:00
rsync -avP --exclude='*.pkg' $(HOME)/Documents/Secure/ \
$(HOME)/tmp/lifeboat.$(YYYYMM)/Secure/
2013-05-14 22:24:10 +00:00
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)
2013-08-13 06:42:47 +00:00
cp $(HOME)/lifeboat.$(YYYYMM).gpg \
$(HOME)/dev/eeqjcdn/sneak.datavibe.net/lifeboat/lifeboat.gpg
cd $(HOME)/dev/eeqjcdn && make
mv $(HOME)/lifeboat.$(YYYYMM).gpg $(HOME)/Documents/Dropbox/Backups/
2013-05-14 22:24:10 +00:00
verify:
duplicity verify --exclude-globbing-filelist \
$(HOME)/.local/etc/duplicity.exclude \
file:///Volumes/EXTUSB01/dup/ ~
2013-12-29 02:17:22 +00:00
remotebackup:
RBACKUPDEST="scp://jp.eeqj.de/backup" $(HOME)/.local/bin/backup.command
packages:
brew install $(BREWPACKAGES)