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.

36 lines
946 B

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