Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- # includo un file esterno con alcune funzioni utili
- source /usr/local/bin/utils.sh
- clear # pulisco lo schermo
- IMAGEFOLDER=/home/rodolfo/WDELEMENTS
- DESTINATIONFOLDER=/home/rodolfo/WDELEMENTS
- WALLPAPERSFOLDER=/home/rodolfo/Dropbox/Rodolfo/immagini/wallpapers
- if [[ $(findmnt -M "$IMAGEFOLDER") ]]; then
- e_success "La cartella immagini è montata"
- else
- e_error "La cartella immagini non è montata"
- e_warning "Per effettuare il backup devi prima montare la cartella Immagini"
- fi
- if [[ -d $DESTINATIONFOLDER ]]; then
- e_success "La cartella di destinazione esiste"
- else
- e_error "La cartella di destinazione $DESTINATIONFOLDER non esiste"
- e_warning "Non è stata trovata la cartella di destinazione $DESTINATIONFOLDER"
- e_error "Esco."
- exit 0
- fi
- echo
- seek_confirmation "Vuoi fare il backup? --> "
- if is_confirmed; then
- rsync -avrz --delete --force $WALLPAPERSFOLDER $DESTINATIONFOLDER
- echo
- e_success "Backup completato"
- echo
- else
- echo
- e_warning "Backup annullato"
- e_error "Esco."
- exit 0
- fi
- exit 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement