Advertisement
rodolforizzo76

bkwallpapers.sh

Aug 25th, 2018
156
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.09 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. # includo un file esterno con alcune funzioni utili
  4. source /usr/local/bin/utils.sh
  5. clear # pulisco lo schermo
  6.  
  7. IMAGEFOLDER=/home/rodolfo/WDELEMENTS
  8. DESTINATIONFOLDER=/home/rodolfo/WDELEMENTS
  9. WALLPAPERSFOLDER=/home/rodolfo/Dropbox/Rodolfo/immagini/wallpapers
  10.  
  11. if [[ $(findmnt -M "$IMAGEFOLDER") ]]; then
  12.     e_success "La cartella immagini è montata"
  13. else
  14.     e_error "La cartella immagini non è montata"
  15.     e_warning "Per effettuare il backup devi prima montare la cartella Immagini"
  16. fi
  17.  
  18. if [[ -d $DESTINATIONFOLDER ]]; then
  19.     e_success "La cartella di destinazione esiste"
  20. else
  21.     e_error "La cartella di destinazione $DESTINATIONFOLDER non esiste"
  22.     e_warning "Non è stata trovata la cartella di destinazione $DESTINATIONFOLDER"
  23.     e_error "Esco."
  24.     exit 0
  25. fi
  26.  
  27. echo
  28. seek_confirmation "Vuoi fare il backup? --> "
  29. if is_confirmed; then
  30.     rsync -avrz --delete --force $WALLPAPERSFOLDER $DESTINATIONFOLDER
  31.    
  32.     echo
  33.     e_success "Backup completato"
  34.     echo
  35. else
  36.     echo
  37.     e_warning "Backup annullato"
  38.     e_error "Esco."
  39.     exit 0
  40. fi
  41.  
  42. exit 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement