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.

90 lines
2.6KB

  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. ~/dev/hacks/bin/backup.command
  33. cleanup:
  34. -mkdir -p $(HOME)/Documents/$(YYYYMM)
  35. -mv $(HOME)/Desktop/* $(HOME)/Documents/$(YYYYMM)
  36. clean: cleanup
  37. @echo $(PREFIX) $@ $(SUFFIX)
  38. @-rm -rf ~/.tmp/*
  39. @-rm -rf ~/.Trash/*
  40. @-rm -rf $(JUNKFILES)
  41. size:
  42. du -sh $(HOME)
  43. lifeboat:
  44. mkdir -p $(HOME)/tmp/lifeboat.$(YYYYMM)
  45. rsync -avP --exclude='*.pkg' $(HOME)/Documents/Secure/ \
  46. $(HOME)/tmp/lifeboat.$(YYYYMM)/Secure/
  47. rsync -avP $(HOME)/Library/ApplicationSupport/Bitcoin/wallet.dat \
  48. $(HOME)/tmp/lifeboat.$(YYYYMM)/wallet.dat
  49. tar -c $(HOME)/tmp/lifeboat.$(YYYYMM) | bzip2 | \
  50. gpg --symmetric -a -o $(HOME)/lifeboat.$(YYYYMM).gpg
  51. rm -rf $(HOME)/tmp/lifeboat.$(YYYYMM)
  52. cp $(HOME)/lifeboat.$(YYYYMM).gpg \
  53. $(HOME)/dev/eeqjcdn/sneak.datavibe.net/lifeboat/lifeboat.gpg
  54. cd $(HOME)/dev/eeqjcdn && make
  55. mv $(HOME)/lifeboat.$(YYYYMM).gpg $(HOME)/Documents/Dropbox/Backups/
  56. verify:
  57. duplicity verify --exclude-globbing-filelist \
  58. $(HOME)/.local/etc/duplicity.exclude \
  59. file:///Volumes/EXTUSB01/dup/ ~
  60. remotebackup:
  61. RBACKUPDEST="scp://jp.eeqj.de/backup" $(HOME)/.local/bin/backup.command
  62. packages:
  63. brew install $(BREWPACKAGES)
  64. # this copies instead of linking because the 'hacks' repo is part of the
  65. # sneak-sync shared folder which is synced with machines off-prem
  66. # and they are not allowed impending RCE on workstations
  67. update:
  68. cat $(HACKSREPO)/homedir.makefile/Makefile > Makefile
  69. brew upgrade