[BASH] Add backup copy routine

This commit is contained in:
Gregory Trolliet 2021-02-06 22:30:22 +01:00
parent 4d9871abf6
commit f85f88f66c

22
.bashrc
View file

@ -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"