dotfiles

My collection of dotfiles
git clone git://git.noxz.tech/dotfiles
Log | Files | Refs

backup (1013B)


      1 #!/bin/sh
      2 
      3 echo -n "Do you wish to backup '$HOME' (y/N)? "
      4 read answer && [ "$answer" = "${answer#[Yy]}" ] && return
      5 
      6 select _repo in local remote
      7 do
      8 	case "$_repo" in
      9 	local)
     10 		borg create                                     \
     11 			--stats                                     \
     12 			--progress                                  \
     13 			--compression lz4                           \
     14 			--exclude "$HOME/mnt"                       \
     15 			--exclude "$HOME/downloads"                 \
     16 			--exclude "$HOME/.cache"                    \
     17 			::{user}-{now} "$HOME"
     18 		return ;;
     19 	remote)
     20 		borg create                                     \
     21 			--stats                                     \
     22 			--progress                                  \
     23 			--compression lz4                           \
     24 			--exclude "$HOME/mnt"                       \
     25 			--exclude "$HOME/downloads"                 \
     26 			--exclude "$HOME/.cache"                    \
     27 			backup:void42::{user}-{now} "$HOME"
     28 		return ;;
     29 	*) echo "select a valid option" ;;
     30 	esac
     31 done