Browse Source

[BASH] Add backup copy routine

master
Gregory Trolliet 10 months ago
parent
commit
f85f88f66c
  1. 22
      .bashrc

22
.bashrc

@ -192,4 +192,26 @@ function pdfcompress(){
gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/$quality -dNOPAUSE -dQUIET -dBATCH -sOutputFile="$2" "$1"
}
function dirsBackup() {
declare -A repo
repo[ragBck]=raghnarok_bck
repo[ragCloud_bck]=ragCloud_bck
repo[nextcloud_bck]=nextcloud_bck
repo[nextcloudSS_bck]=nextcloudSS_bck
LOCAL="/media/HDD1/"
DISTANT="/media/raghnarok/ragBck"
read -p "Disque cible (01 ou 02): " dst
DISTANT="$DISTANT$dst/"
for key in "${!repo[@]}";
do
echo "$key -> ${repo[$key]}"
rsync -av --delete "$LOCAL$key/" "$DISTANT${repo[$key]}/"
done
echo "music -> music_bck"
rsync -av --delete "/media/ragnas/music/" "$DISTANT/music_bck/"
}
export PATH="$HOME/.cargo/bin:$PATH"

Loading…
Cancel
Save