Dotfiles for my tiling window manager + terminal workflow.
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.

31 lines
813 B

  1. #!/bin/bash
  2. mount_dir="/run/media/kevin/backup-hd"
  3. # Backup destination
  4. case $1 in
  5. nzxt )
  6. backup_dest="$mount_dir/nzxt"
  7. # backup_dest="$mount_dir/backup-usb/nzxt"
  8. ;;
  9. x1 )
  10. backup_dest="$mount_dir/laptop"
  11. ;;
  12. esac
  13. exclude_dirs_list="/home/kevin/txt/exclude-dirs-backup.txt"
  14. exclude_dirs_list_full="/home/kevin/txt/exclude-dirs-backup-full.txt"
  15. case $2 in
  16. tar-root )
  17. # Labels for backup name
  18. distro="arch"
  19. datetime=$(date "+%m.%d-%H.%M")
  20. backup_file="$backup_dest/tar/$datetime-$distro-root.tar.gz"
  21. sudo tar -czpvf "$backup_file" --exclude-from="$exclude_dirs_list" --exclude=/home /
  22. ;;
  23. full )
  24. sudo rsync -PraAX --exclude-from="$exclude_dirs_list_full" / "$backup_dest/full"
  25. ;;
  26. home )
  27. sudo rsync -PraAX --exclude-from="$exclude_dirs_list_full" /home "$backup_dest/full"
  28. esac