[BASH] Add backup copy routine
This commit is contained in:
parent
4d9871abf6
commit
f85f88f66c
1 changed files with 22 additions and 0 deletions
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…
Reference in a new issue