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
867 B

6 years ago
  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 )
  17. # Labels for backup name
  18. distro="arch"
  19. datetime=$(date "+%m.%d-%H.%M")
  20. backup_file="$backup_dest/tar/$datetime-$distro.tar.gz"
  21. sudo tar -czpvf "$backup_file" --exclude-from="$exclude_dirs_list" /
  22. ;;
  23. full )
  24. sudo rsync -PraAX --exclude-from="$exclude_dirs_list_full" / "$backup_dest/full"
  25. # sudo rsync -PraAX /home "$backup_dest/full"
  26. # echo rsync -PraAX --exclude-from="$exclude_dirs_list_full" / "$backup_dest/full"
  27. # echo rsync -PraAX /home "$backup_dest/full/home"
  28. esac