Added full rsync backup

This commit is contained in:
2018-12-20 01:57:47 -05:00
parent 7abdbfa9d9
commit 1c200b74a7
7 changed files with 35 additions and 15 deletions

View File

@@ -16,7 +16,7 @@ are also for my Linux
* **Terminal**: [rxvt-unicode-pixbuf](https://www.wikiwand.com/en/Rxvt) * **Terminal**: [rxvt-unicode-pixbuf](https://www.wikiwand.com/en/Rxvt)
* **Shell**: [Zsh](http://zsh.sourceforge.net/) + [oh-my-zsh](https://github.com/robbyrussell/oh-my-zsh) * **Shell**: [Zsh](http://zsh.sourceforge.net/) + [oh-my-zsh](https://github.com/robbyrussell/oh-my-zsh)
* **Window Manager**: [i3-gaps](https://github.com/Airblader/i3) * **Window Manager**: [i3-gaps](https://github.com/Airblader/i3)
* **Editor**: [Neovim](https://github.com/neovim/neovim) ([plugins](dotfiles/vimrc#L51)) * **Editor**: [Neovim](https://github.com/neovim/neovim) ([plugins](dotfiles/.vimrc#L51))
* **File Manager**: [ranger](https://ranger.github.io/) * **File Manager**: [ranger](https://ranger.github.io/)
<!--- }}} Basic Info --> <!--- }}} Basic Info -->

View File

@@ -262,7 +262,7 @@ function gcm(){ echo git commit -m \""$1"\" ; }
function psgi() { function psgi() {
git add . git add .
git commit -m -S '.' git commit -mS '.'
git push git push
} }
alias gps="git push" alias gps="git push"

View File

@@ -336,7 +336,7 @@ public_ip_host="http://ident.me"
# disk_show=('/'): # disk_show=('/'):
# 'Disk (/): 74G / 118G (66%)' # 'Disk (/): 74G / 118G (66%)'
# #
disk_show=('/' '/dev/sda3') disk_show=('/' '/home' )
# Disk subtitle. # Disk subtitle.
# What to append to the Disk subtitle. # What to append to the Disk subtitle.

View File

@@ -193,8 +193,8 @@ nnoremap <C-w> <C-W>|
" leader mappings {{{ " " leader mappings {{{ "
let mapleader="\<Space>" let mapleader="\<Space>"
" replace vim-commentary Markdown comments with HTML " replace until end of line
nnoremap <leader>cmt :%s/>\(.*\)>/<!---\1-->/g<CR> nnoremap <leader>c c$
" delete entire buffer " delete entire buffer
nnoremap <leader>dg ggdG nnoremap <leader>dg ggdG
" delete line into system clipboard " delete line into system clipboard

View File

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

View File

@@ -19,14 +19,14 @@ link_to_lc () {
item_name=$(basename -- "$item") item_name=$(basename -- "$item")
# echo "$item_name" # echo "$item_name"
# Remove system item and link config in repository to system. # Remove system item and link config in repository to system.
rm -f "${sys_dir:?}"/"$item_name" rm -rf "${sys_dir:?}"/"$item_name"
ln -s "$config_dir"/"$item_name" "$sys_dir"/"$item_name" && echo "Linked $item_name." ln -s "$config_dir"/"$item_name" "$sys_dir"/"$item_name" && echo "Linked $item_name."
done done
} }
link_to_lc "files" "$HOME" "$lc_dir/dotfiles" link_to_lc "files" "$HOME" "$lc_dir/dotfiles"
# link_to_lc "dirs" "$HOME/.config" "$lc_dir/configs" link_to_lc "dirs" "$HOME/.config" "$lc_dir/configs"
# link_to_lc "dirs" "$HOME/.themes" "$lc_dir/gtk/themes" link_to_lc "dirs" "$HOME/.themes" "$lc_dir/gtk/themes"
# setup nvim config # setup nvim config
# nvim_file="/home/kevin/lc-test/init.vim" # nvim_file="/home/kevin/lc-test/init.vim"

View File

@@ -0,0 +1,8 @@
/dev/*
/lost+found
/media/*
/mnt/*
/proc/*
/run/*
/sys/*
/tmp/*