Advertisement
Guest User

Untitled

a guest
Feb 2nd, 2021
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.70 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. # DO NOT CHANGE THIS UNLESS UNRAID CHANGES BACKUP PATH
  4. backup_script="/usr/local/emhttp/webGui/scripts/flash_backup"
  5. notify_script="/usr/local/emhttp/webGui/scripts/notify"
  6. # DO NOT CHANGE ABOVE THIS LINE
  7.  
  8. # CONFIG START - CHANGE THIS
  9. dropbox_dir="/mnt/user/Dropbox/unRAID-backup/"
  10. # CONFIG END
  11.  
  12. if [ ! -f "$backup_script" ]; then
  13.     "$notify_script" -i alert -s "Backup script does not exist. Backup of USB not possible!"
  14.     exit
  15. fi
  16.  
  17. zip="$(${backup_script})"
  18.  
  19. if [ ! -f "/$zip" ]; then
  20.     "$notify_script" -i alert -s "Backup script ran successfully, however, backup file does not exist on disk!"
  21.     exit
  22. fi
  23.  
  24. mv "/${zip}" "${dropbox_dir}"
  25.  
  26. chmod 777 "${dropbox_dir}/${zip}"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement