February 2, 20224 yr Author 1 hour ago, L0rdRaiden said: Thanks, it works perfectly I have learnt a lot with you Together with this Script (the first one in my life) and Kopia I have tune up my backup system #!/bin/bash /usr/local/emhttp/webGui/scripts/notify -e "Unraid Server Notice" -s "OneDrive backup started" -d "Synchronizing Kopia backup to OneDrive" -i "normal" echo 'OneDrive backup started' rclone sync /mnt/user/Backup/Kopia OneDrive:"/Backup/Kopia" /usr/local/emhttp/webGui/scripts/notify -e "Unraid Server Notice" -s "OneDrive backup finished" -d "Synchronization completed" -i "normal" echo 'One Drive backup completed' good deal! glad it all worked out.
February 5, 20224 yr You are my Hero! After 3 Hours searching for a possibility to daily Backup the Flashdrive or its content i found this script. And what to say... Create Folders C&P the Script Fill the blanks Set the Schedule Fire and Forget Awesome! Thank you P.S: optional e-mail notification would be nice (i'm not so ften on my unraid gui) Edited February 5, 20224 yr by Protheus
February 5, 20224 yr 34 minutes ago, Protheus said: You are my Hero! After 3 Hours searching for a possibility to daily Backup the Flashdrive or its content i found this script. And what to say... Create Folders C&P the Script Fill the blanks Set the Schedule Fire and Forget Awesome! Thank you P.S: optional e-mail notification would be nice (i'm not so ften on my unraid gui) I have all the Unraid notifications on telegram. I think it was configured from the settings page
February 5, 20224 yr 47 minutes ago, L0rdRaiden said: I have all the Unraid notifications on telegram. I think it was configured from the settings page Hm...you're right. I have Telegram configured too. But...i didn't ever noticed that it not work anymore 😕 Edit: Ok that is working now. But i get all messages twice If someone have a clue please PM me. Edited February 5, 20224 yr by Protheus
February 10, 20224 yr Author On 2/5/2022 at 2:30 PM, Protheus said: You are my Hero! After 3 Hours searching for a possibility to daily Backup the Flashdrive or its content i found this script. And what to say... Create Folders C&P the Script Fill the blanks Set the Schedule Fire and Forget Awesome! Thank you P.S: optional e-mail notification would be nice (i'm not so ften on my unraid gui) Glad you like it! At the moment, i don't have enough hours in the day to tackle e-mail notifications for this. Maybe someone else could tack on and i'd be happy to add to the OP. If not, perhaps at some point in the future I could see what i can do in that regard. Cheers!
March 23, 20224 yr The Notification is only GUI? No Mail or others when this in the Notification Settings defined?
March 24, 20224 yr I only use email notifications but it’s my understanding that whatever forms of notification you have enabled will be used.
November 6, 20223 yr I know I'm late to this party but, I tried this script and found my "native unraid backup script" is missing/deleted. Has the native backup script referenced been removed by the Unraid updates due to the backing up to their online? If so, any chance on updating the script to to work without the native one? Anyways thank you.
November 6, 20223 yr Nevermind. I fixed it. But thank you for the scripts. This one and the Plex one!!!!
November 13, 20223 yr Thanks a lot for this great script. Found this page after restoring my USB flash drive that recently died and realising that the last backup happened to be 1.5 years old 🙄 Edited November 13, 20223 yr by rob_robot
February 27, 20233 yr So I am brand new to unraid, just built my first server this past weekend. I previous only had synology NAS for about a year. Mainly running plex server. I ran the script from watching the youtube video, I copied the script from your google link in the video description. My destination was a remote SMB share on my synology NAS. So the only thing I did different from your video was the destination and changed my tower name in the notification part and removed the # from the beginning. However after I manually ran the script it caused my server to crash. Kept saying directory not found over and over. WEBGUI was not working and I had to unplug my server from power and reboot. Im running on Unraid 6.11.5. Does this still work and does it work for Remote SMB shares?
February 27, 20233 yr How's the remote smb share mounted? It would need to be mounted, that'd have to be checked etc
February 28, 20233 yr 12 hours ago, Kilrah said: How's the remote smb share mounted? It would need to be mounted, that'd have to be checked etc Yeah it is mounted.
March 12, 20251 yr Any changes under Unraid 7 needed? Please add a Version Number in the Script for tracking changes.
March 13, 20251 yr Author Honestly I haven’t looked at this in a couple years. I’d be happy to take another gander at it this weekend. Until I repost some sort of update, I have posted what versions this has been tested on and any versions not included in that should be used with extreme caution. it’s been semi deprecated since myunraid plugin backs up the flash drive.
March 13, 20251 yr 1 hour ago, Cpt. Chaz said: it’s been semi deprecated since myunraid plugin backs up the flash drive. OK, I don't used it. Locally Backups/no extern access are more likely. 1 hour ago, Cpt. Chaz said: I’d be happy to take another gander at it this weekend. Many Thanks! I'm curious.
March 13, 20251 yr Nothing's changed in the flash backup method for a looong while. Also Appdata Backup plugin takes care of that for most people.
March 13, 20251 yr 2 minutes ago, Kilrah said: Appdata Backup plugin Unless it makes the backup to an Unassigned Device, you will be in the Catch-22 situation of needing to boot Unraid to get the backup you need to boot Unraid.
March 14, 20251 yr 9 hours ago, trurl said: Unless it makes the backup to an Unassigned Device, you will be in the Catch-22 situation of needing to boot Unraid to get the backup you need to boot Unraid. Obviously you need to choose your destination wisely, same as this script or any method. It has a field for a 2nd location to copy to. I don't use it, but rsync my appdata backups to another machine. Edited March 14, 20251 yr by Kilrah
March 14, 20251 yr I use Unraid Connect (offsite backup of flash), Appdata Backup (yes it's on the array but I know how to get it if I really need to go to the trouble) and also manually download flash backup before and after Unraid version change, or any important change to my configuration. And I never have trouble with my boot flash, but you never know what might happen.
April 24, 20251 yr On 3/12/2025 at 7:34 PM, Cpt. Chaz said: Honestly I haven’t looked at this in a couple years. I’d be happy to take another gander at it this weekend. Until I repost some sort of update, I have posted what versions this has been tested on and any versions not included in that should be used with extreme caution. it’s been semi deprecated since myunraid plugin backs up the flash drive. What unraid plugin are you talking about? Ive been using your user script but I'm also interested in the plugin also!
April 24, 20251 yr 48 minutes ago, DarkZennen said: What unraid plugin are you talking about? Unraid Connect. The Appdata backup plugin can back up the flash too and is a common solution for that since you typically do want to backup your appdata anyway.
May 26May 26 I noticed this broke when I updated to v7.3.0.Only issue appears to be that the generated backup name changed from flash-backup to boot-backup.Depending on how many days since you upgraded you may have a lot of copies of your flash backup in / so delete them or move them to their intended location so they aren't lost on reboot.EDIT: just decided to copy out my copy of the script and paste it here. This is with the latest fix for v7.3.0#!/bin/bash ##### PRE RUN CHECK IF ARRAY IS STARTED ###### ls /mnt/disk[1-9]* 1>/dev/null 2>/dev/null if [ $? -ne 0 ] then echo "ERROR: Array must be started before using this script" logger "ERROR: Array must be started before using this script" exit fi #### SECTION 1 ####------------------------------------------------------------------------------------------------------ #dir = WHATEVER FOLDER PATH YOU WANT TO SAVE TO dir="YOUR_DIR_HERE" echo 'Executing native unraid backup script' /usr/local/emhttp/webGui/scripts/flash_backup #### SECTION 2 ####------------------------------------------------------------------------------------------------------ echo 'Remove symlink from emhttp' find /usr/local/emhttp/ -maxdepth 1 -name '*boot-backup-*.zip' -delete sleep 5 #### SECTION 3 ####------------------------------------------------------------------------------------------------------ if [ ! -d "$dir" ] ; then echo "making directory as it does not yet exist" # make the directory as it doesnt exist mkdir -vp "$dir" else echo "As $dir exists continuing." fi #### SECTION 4 ####------------------------------------------------------------------------------------------------------ echo 'Move Flash Zip Backup from Root to Backup Destination' mv /*-boot-backup-*.zip "$dir" sleep 5 #### SECTION 5 ####------------------------------------------------------------------------------------------------------ echo 'Deleting Old Backups' #ENTER NUMERIC VALUE OF DAYS AFTER "-MTIME +" find "$dir"* -mtime +YOUR_DAYS_HERE -exec rm -rfv {} \; echo 'All Done' #### SECTION 6 ####------------------------------------------------------------------------------------------------------ #UNCOMMENT THE NEXT LINE TO ENABLE GUI NOTIFICATION UPON COMPLETION /usr/local/emhttp/webGui/scripts/notify -e "Unraid Server Notice" -s "Flash Zip Backup" -d "A copy of tower unraid flash disk has been backed up" -i "normal" exit Edited May 26May 26 by weirdcrap
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.