backup-configs.sh 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. #!/usr/bin/env bash
  2. set -euo pipefail # bash strict mode
  3. # # TODO
  4. # ## Make this script works with other archive protocols like zst lzma
  5. # if [[ $1 == *'.gpg' ]]; then
  6. # gpg -d "$1" | tar -xzvpf -
  7. # exit
  8. # fi
  9. # sudo tar -czvpf - \
  10. # /etc/fstab \
  11. # ~/org \
  12. # ~/Documents/{org} \
  13. # ~/.icons \
  14. # ~/.var \
  15. # ~/.*{wm,rc,conf,_profile,env,.d,moonchild*,gtkrc*} \
  16. # ~/.local/{bin,share/applications/*.desktop} \
  17. # ~/.config/{cmus,*wm,i3*,neofetch,zathura,vifm,nvim,mimeapps.list} \
  18. # ~/.config/{rofi,mpv,aerc,alacritty,geany,strawberry,pcmanfm,transmission*,awesome,qtile} \
  19. # ~/.config/{dunst,rox*,qutebrowser,falkon} \
  20. # | gpg --symmetric --cipher-algo aes256 -o "${arc}.gpg"
  21. ####################################################################################
  22. dest="${HOME}/Dotfiles"
  23. rsync -ruRmP --mkpath --max-size=2m \
  24. ~/.icons \
  25. ~/.*{wm,rc,conf,_profile,env,gtkrc*} \
  26. ~/.local/{org,share/applications/*.desktop} \
  27. ~/.config/{*wm,i3*,rox*} \
  28. ~/.config/{neofetch,zathura,vifm,nvim,mimeapps.list,cmus,rofi,mpv/mpv.conf,aerc,alacritty,geany,strawberry,pcmanfm,transmission*/*.json,awesome,qtile} \
  29. ~/.config/{dunst,rox*,qutebrowser} \
  30. "/tmp"
  31. # rm -rf "$dest"
  32. cp -r "/tmp/home/${USER}/" "$dest/"
  33. # arc="backup-configs_$(date +'%Y-%m-%d').tar.gz"
  34. # tar -czvpf "$dest" "$arc"