hacks/homedir.makefile/Makefile

93 lines
2.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
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
2020-02-15 21:38:59 +00:00
HACKSREPO := ~/.paths/sneak-scratch/dev/hacks/
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)"
2019-10-31 13:38:17 +00:00
default: routine
# FIXME make this do a local imap download too
routine: clean databackup
2012-06-20 08:22:58 +00:00
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 -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
rsync -e "ssh -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/
2014-01-30 06:27:57 +00:00
tar -xvf $(HOME)/Documents/Archival/mail/jp.eeqj.com | gzip > \
$(HOME)/Documents/Dropbox/eeqj/archives/mail.tgz.new && \
mv $(HOME)/Documents/Dropbox/eeqj/archives/mail.tgz.new \
$(HOME)/Documents/Dropbox/eeqj/archives/mail.tgz
2013-03-03 22:29:23 +00:00
2019-03-21 01:01:13 +00:00
databackup:
2019-03-29 08:13:38 +00:00
mkdir -p $(HOME)/Library/misc
brew list > $(HOME)/Library/misc/brewinstalled.txt
brew cask list > $(HOME)/Library/misc/brew-cask-installed.txt
2019-03-21 01:01:13 +00:00
~/dev/hacks/bin/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 ~/.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)
2020-02-15 21:38:59 +00:00
# this copies instead of linking because the 'hacks' repo is part of the
# sneak-sync shared folder which is synced with machines off-prem
# and they are not allowed impending RCE on workstations
update:
cat $(HACKSREPO)/homedir.makefile/Makefile > Makefile
brew upgrade