You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

93 lines
2.7KB

  1. JUNKFILES = .bash_history .irb_history .pip .ScanSnap .nbems .fldigi .cpan
  2. JUNKFILES += .gdb_history .mysql_history .sqlite_history
  3. BREWPACKAGES := mosh duplicity pv offlineimap wget nmap tor torsocks
  4. YYYYMM := $(shell date +%Y%m)
  5. HACKSREPO := ~/.paths/sneak-scratch/dev/hacks/
  6. NO_COLOR = \033[0m
  7. O1_COLOR = \033[0;01m
  8. O2_COLOR = \033[32;01m
  9. PREFIX = "$(O2_COLOR)==>$(O1_COLOR)"
  10. SUFFIX = "$(NO_COLOR)"
  11. default: routine
  12. # FIXME make this do a local imap download too
  13. routine: clean databackup
  14. backup: clean mailoffsite databackup
  15. dvbackup:
  16. @echo $(PREFIX) $@ $(SUFFIX)
  17. cd ~/Documents/datavibe/backup && make
  18. imapbackup:
  19. offlineimap
  20. rsync -e "ssh -o Compression=no -x" \
  21. -avPhzy --delete-after sneak@datavibe.net:.maildir/ \
  22. $(HOME)/Documents/Archival/mail/sneak.datavibe.net.maildir/
  23. mailoffsite: imapbackup
  24. rsync -e "ssh -o Compression=no -x" \
  25. -avPhzy --delete-after $(HOME)/Documents/Archival/mail/ \
  26. sneak@datavibe.net:.mailbackup/
  27. tar -xvf $(HOME)/Documents/Archival/mail/jp.eeqj.com | gzip > \
  28. $(HOME)/Documents/Dropbox/eeqj/archives/mail.tgz.new && \
  29. mv $(HOME)/Documents/Dropbox/eeqj/archives/mail.tgz.new \
  30. $(HOME)/Documents/Dropbox/eeqj/archives/mail.tgz
  31. databackup:
  32. mkdir -p $(HOME)/Library/misc
  33. #brew list > $(HOME)/Library/misc/brewinstalled.txt
  34. #brew cask list > $(HOME)/Library/misc/brew-cask-installed.txt
  35. ~/dev/hacks/bin/backup.command
  36. cleanup:
  37. -mkdir -p $(HOME)/Documents/$(YYYYMM)
  38. -mv $(HOME)/Desktop/* $(HOME)/Documents/$(YYYYMM)
  39. clean: cleanup
  40. @echo $(PREFIX) $@ $(SUFFIX)
  41. @-rm -rf ~/.tmp/*
  42. @-rm -rf ~/.Trash/*
  43. @-rm -rf $(JUNKFILES)
  44. size:
  45. du -sh $(HOME)
  46. lifeboat:
  47. mkdir -p $(HOME)/tmp/lifeboat.$(YYYYMM)
  48. rsync -avP --exclude='*.pkg' $(HOME)/Documents/Secure/ \
  49. $(HOME)/tmp/lifeboat.$(YYYYMM)/Secure/
  50. rsync -avP $(HOME)/Library/ApplicationSupport/Bitcoin/wallet.dat \
  51. $(HOME)/tmp/lifeboat.$(YYYYMM)/wallet.dat
  52. tar -c $(HOME)/tmp/lifeboat.$(YYYYMM) | bzip2 | \
  53. gpg --symmetric -a -o $(HOME)/lifeboat.$(YYYYMM).gpg
  54. rm -rf $(HOME)/tmp/lifeboat.$(YYYYMM)
  55. cp $(HOME)/lifeboat.$(YYYYMM).gpg \
  56. $(HOME)/dev/eeqjcdn/sneak.datavibe.net/lifeboat/lifeboat.gpg
  57. cd $(HOME)/dev/eeqjcdn && make
  58. mv $(HOME)/lifeboat.$(YYYYMM).gpg $(HOME)/Documents/Dropbox/Backups/
  59. verify:
  60. duplicity verify --exclude-globbing-filelist \
  61. $(HOME)/.local/etc/duplicity.exclude \
  62. file:///Volumes/EXTUSB01/dup/ ~
  63. remotebackup:
  64. RBACKUPDEST="scp://jp.eeqj.de/backup" $(HOME)/.local/bin/backup.command
  65. packages:
  66. brew install $(BREWPACKAGES)
  67. # this copies instead of linking because the 'hacks' repo is part of the
  68. # sneak-sync shared folder which is synced with machines off-prem
  69. # and they are not allowed impending RCE on workstations
  70. update:
  71. cat $(HACKSREPO)/homedir.makefile/Makefile > Makefile
  72. brew upgrade