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.

32 lines
852 B

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. x1 )
  11. backup_dest="$mount_dir/laptop"
  12. ;;
  13. esac
  14. exclude_dirs_list="/home/kevin/txt/exclude-dirs-backup.txt"
  15. exclude_dirs_list_full="/home/kevin/txt/exclude-dirs-backup-full.txt"
  16. case $2 in
  17. tar-root )
  18. # Labels for backup name
  19. distro="arch"
  20. datetime=$(date "+%m.%d-%H.%M")
  21. backup_file="$backup_dest/tar/$datetime-$distro-root.tar.gz"
  22. sudo tar -czpvf "$backup_file" --exclude-from="$exclude_dirs_list" --exclude=/home /
  23. ;;
  24. # full )
  25. # sudo rsync -PraAX --exclude-from="$exclude_dirs_list_full" / "$backup_dest/full"
  26. # ;;
  27. home )
  28. sudo rsync -PraAX --exclude-from="$exclude_dirs_list_full" /home "$backup_dest/full"
  29. esac