Browse Source

Added backup script

red-hat-laptop
Kevin Mok 6 years ago
parent
commit
e58891c736
  1. 2
      aliases/zsh_aliases
  2. 12
      backup.sh
  3. 2
      dirs.sh
  4. 2
      x/marble-mouse/set-config.sh

2
aliases/zsh_aliases

@ -71,7 +71,7 @@ alias "f.."="f ..."
function mvd() { mv $1 ~/Downloads ; } function mvd() { mv $1 ~/Downloads ; }
alias lhd="sudo fdisk -l" alias lhd="sudo fdisk -l"
alias ds="df -h | grep sd" 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 # # }}} directory-related #

12
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 /

2
dirs.sh

@ -1,3 +1,5 @@
#!/bin/sh
linux_config_dir=~/linux-config linux_config_dir=~/linux-config
dot_dir=$linux_config_dir/dotfiles dot_dir=$linux_config_dir/dotfiles
config_dir=$linux_config_dir/configs config_dir=$linux_config_dir/configs

2
x/marble-mouse/set-config.sh

@ -1,7 +1,7 @@
#!/bin/sh #!/bin/sh
# Get directory variables from script. # Get directory variables from script.
sh ../../dirs.sh
. ../../dirs.sh
config_file_name="10-evdev.conf" config_file_name="10-evdev.conf"
sys_layout_file="/etc/X11/xorg.conf.d/$config_file_name" sys_layout_file="/etc/X11/xorg.conf.d/$config_file_name"

Loading…
Cancel
Save