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
31 lines
867 B
#!/bin/bash
|
|
|
|
mount_dir="/run/media/kevin/backup-hd"
|
|
# Backup destination
|
|
case $1 in
|
|
nzxt )
|
|
backup_dest="$mount_dir/nzxt"
|
|
# backup_dest="$mount_dir/backup-usb/nzxt"
|
|
;;
|
|
x1 )
|
|
backup_dest="$mount_dir/laptop"
|
|
;;
|
|
esac
|
|
exclude_dirs_list="/home/kevin/txt/exclude-dirs-backup.txt"
|
|
exclude_dirs_list_full="/home/kevin/txt/exclude-dirs-backup-full.txt"
|
|
|
|
case $2 in
|
|
tar )
|
|
# Labels for backup name
|
|
distro="arch"
|
|
datetime=$(date "+%m.%d-%H.%M")
|
|
backup_file="$backup_dest/tar/$datetime-$distro.tar.gz"
|
|
|
|
sudo tar -czpvf "$backup_file" --exclude-from="$exclude_dirs_list" /
|
|
;;
|
|
full )
|
|
sudo rsync -PraAX --exclude-from="$exclude_dirs_list_full" / "$backup_dest/full"
|
|
# sudo rsync -PraAX /home "$backup_dest/full"
|
|
# echo rsync -PraAX --exclude-from="$exclude_dirs_list_full" / "$backup_dest/full"
|
|
# echo rsync -PraAX /home "$backup_dest/full/home"
|
|
esac
|