From e58891c7368b9278bb6accc37d0bb2fe91824cf4 Mon Sep 17 00:00:00 2001 From: Kevin Mok Date: Mon, 3 Dec 2018 15:55:51 -0500 Subject: [PATCH] Added backup script --- aliases/zsh_aliases | 2 +- backup.sh | 12 ++++++++++++ dirs.sh | 2 ++ x/marble-mouse/set-config.sh | 2 +- 4 files changed, 16 insertions(+), 2 deletions(-) create mode 100755 backup.sh diff --git a/aliases/zsh_aliases b/aliases/zsh_aliases index 9ae6333..742fe73 100644 --- a/aliases/zsh_aliases +++ b/aliases/zsh_aliases @@ -71,7 +71,7 @@ alias "f.."="f ..." function mvd() { mv $1 ~/Downloads ; } alias lhd="sudo fdisk -l" alias ds="df -h | grep sd" -alias nbu="ll /run/media/kevin/pc-backup/backups/nzxt | grep tgz" +alias nbu="f /run/media/kevin/pc-backup/backups/nzxt && ll | grep gz" # }}} directory-related # diff --git a/backup.sh b/backup.sh new file mode 100755 index 0000000..6b1f3bf --- /dev/null +++ b/backup.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +# Backup destination +backup_dest=/run/media/kevin/pc-backup/backups/nzxt + +# Labels for backup name +PC=${HOST} +distro=arch +datetime=$(date "+%m.%d-%H.%M") +backupfile="$backup_dest/$datetime-$distro.tar.gz" + +sudo tar -czpvf $backupfile --exclude=/lost+found --exclude=/mnt --exclude=/proc --exclude=/run --exclude=/sys / diff --git a/dirs.sh b/dirs.sh index e96d4a9..03bf10b 100755 --- a/dirs.sh +++ b/dirs.sh @@ -1,3 +1,5 @@ +#!/bin/sh + linux_config_dir=~/linux-config dot_dir=$linux_config_dir/dotfiles config_dir=$linux_config_dir/configs diff --git a/x/marble-mouse/set-config.sh b/x/marble-mouse/set-config.sh index 9131665..852288c 100755 --- a/x/marble-mouse/set-config.sh +++ b/x/marble-mouse/set-config.sh @@ -1,7 +1,7 @@ #!/bin/sh # Get directory variables from script. -sh ../../dirs.sh +. ../../dirs.sh config_file_name="10-evdev.conf" sys_layout_file="/etc/X11/xorg.conf.d/$config_file_name"