[Plugin] CA Appdata Backup / Restore v2


Squid

Recommended Posts

2 hours ago, FlyingTexan said:

I use the same USB that's already in the system with an OS or if I want to use a secondary USB

Why would you want to make a backup of the flash drive to the same flash drive????  The plugin is open ended and allows you to select any destination you want for any of the options.  Doesn't really help for disaster recovery to store the backup on what you're backing up on the same device

 

How would you change the naming of the various options?

 

Link to comment
15 hours ago, Squid said:

The options the plugin uses on a restore is -xvaf 

I'm still getting the error below...is my tar backup bad? 
 

Plex-Media-Server/Library/Application Support/Plex Media Server/Metadata/Albums/a/92fd63c59b1620e87a3bdc7cbc78c6ecd46f7e7.bundle/Contents/tv.plex.agents.music/posters/3901c63bbf7d6e1dba7fa5c8eef75b0fc2c11b4b
tar: Skipping to next header
tar: Exiting with failure status due to previous errors

 

Link to comment

I've successfully run appdata backup in the past, but today when I launched a manual backup, it stopped the dockers, ran - but didn't back up anything - and then restarted the dockers. I confirmed the paths and made sure nothing was excluded.  My appdata folder is 400gb and takes several hours to run, usually. 

The status gave this message: "Backup/Restore Complete. tar Return Value: 0"

 

My unRAID server is otherwise working great. I am up-to-date for unRAID OS and CA Backup / Restore Appdata.

 

Any thoughts about how to troubleshoot this?

 

Link to comment

Long story short i had some problems with my cache drive, so now my appdata folder has been copied to the array and the cache drive is formatted. I am trying to restore the appdata from the disk back on to the cache but it says "No Backup Sets Found" which i assume is because the appdata folder has been copied and not created with the plugin. What do i need to do to be able to restore it? Do i have to create a backup with the tool using the appdata folder on the disk as source?

Link to comment
20 hours ago, Squid said:

What it looks like.  I don't have any other suggestions though.  I test my server on average about every 6 months with this stuff.

Thanks. I did a fresh backup with and without compression yesterday and was able to extract just fine. Weird. 

On the topic of extraction- is it possible to add an option to create tars for each docker vs. one giant one? With stuff like Plex, Radarr and Config folders it can be pretty intensive to work with a backup, esp. if you only need one thing. I know the intended use of this is to automate things, but there are probably more than a few folks who would appreciate the option(s). 

Thanks for the work on this plugin btw!!

Link to comment

Good Afternoon, 

 

I'd like to create a user script that monitors the duration of an appdata backup job, and notifies me if it crosses a certain runtime.. The reason is I recently had some server issues (corrupted cache drive) that (among other things) prevented dockers from responding correctly. I had an appdata backup job that was trying to run for over a week, but was hung due to the docker/cache drive issue. I was able to recover, but only from a very old appdata backup. Since the backup job technically never failed, I was not alerted. 

 

I've created a script to alert me if my appdata backups are stale, but I'd also like something to monitor my backup job runtime. Adding a runtime watchdog such as this will be part of my belt and suspenders approach to (hopefully) ensure that I never have a missing appdata backup again. 

 

 

I need some help with the "appdata backup job started 5 hours ago and is still running" logic for the script (see below) 

Where/how can I query the status of and runtime of a CA backup job? 

 

 

Here's what I'm envisioning - 

 

if [[ $(appdata backup job started 5 hours ago and is still running) ]]; 
then
     echo "CA Backup runtime is unhealthy" 
     /usr/local/emhttp/webGui/scripts/notify -s "CA Backup runtime is unhealthy" -i "alert" -m "This alert was triggered by the ca_backup_time_watchdog script. Backup runtime is unhealthy"  -d "A CA backup job was started over 5 hours ago and still has not completed. Check AppData backup for hung jobs or other issues."
else
     echo "Recent CA Backup runtime is healthy"
     /usr/local/emhttp/webGui/scripts/notify -s "CA Backup runtimes is healthy" -i "normal" -m "Backup runtimes look good" -d "CA AppData Backup runtime is/was less than 5 hours. All is well with the cosmos." 

fi

 

 

Any help is appreciated! 

Thank you

 

Link to comment

@Squid

As posted in the other thread(https://forums.unraid.net/topic/47266-plugin-ca-fix-common-problems/?do=findComment&comment=1086953),  I'm investigating cause of the permission/ownership change in my appdata folder.  I ran the backup again last night, confirming the ownership of my test folder have changed this morning again.  Is this is an expected behaviour after running a back up?

before 

drwxrwxrwx 1 root   root        0 Jan 19 10:38 test/
drwxrwxrwx 1 root   root        0 Jan 19 10:37 test_delete/
after

drwxrwxrwx 1 nobody users       0 Jan 19 10:38 test/
drwxrwxrwx 1 nobody users       0 Jan 19 10:37 test_delete/

Thanks.

 

Edited by LeoRX
added link to previous post.
Link to comment
3 hours ago, Squid said:

What are those folders? The source or the destination?  Destination permissions are irrelevant

they are source.  I created 2 empty folders in appdata to see if if the ownership gets changed overnight.

I just can't think of anything else that was schedule to run.  I'll recreate the folder and run backup again to confirm.

Link to comment

umm.. confirming the ownerships are being changed to nobody:users.  I ran stat ./test before and after the backup process.


root@Node:/mnt/user/appdata# root@Node:/mnt/user/appdata# stat ./test
  File: ./test
  Size: 0               Blocks: 0          IO Block: 4096   directory
Device: 0,52    Inode: 14073748865542626  Links: 1
Access: (0777/drwxrwxrwx)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2022-01-21 13:19:40.528879285 +1100
Modify: 2022-01-21 13:19:40.528879285 +1100
Change: 2022-01-21 13:19:40.528879285 +1100
 Birth: -
root@Node:/mnt/user/appdata# stat ./test
  File: ./test
  Size: 0               Blocks: 0          IO Block: 4096   directory
Device: 0,52    Inode: 14073748865542626  Links: 1
Access: (0777/drwxrwxrwx)  Uid: (   99/  nobody)   Gid: (  100/   users)
Access: 2022-01-21 13:19:40.528879285 +1100
Modify: 2022-01-21 13:19:40.528879285 +1100
Change: 2022-01-21 13:55:23.523670898 +1100
 Birth: -
 

Edited by LeoRX
Link to comment

I chmod 0777 the destinations for easy access via SMB.  Source I don't touch.

 

Mine don't change:  Here's my before and after.  The first root:root after andrew:users is a new directory I created, and it didn't change either modify time or permissions.  Are you referencing that test directory in a container anywhere?

image.thumb.png.cc802e9ce394aa6b99a61d304e921915.png

Link to comment

The test path is /mnt/user/appdata/test, under Unraid OS.

I just tested it again just to make sure I'm not crazy.
It is very strange no one noticed this behaviour.. which means its either something else that's causing it, something specific to my computer, settings or I'm just crazy. 

can you please confirm if your destination share path is default or customised path?  If its default, will you mind test it with a custopm path please?
2060582995_Screenshot2022-01-23110315.thumb.png.0e4242ca5abe00f490f5aebb445ebbed.png

Link to comment

There are no preset paths in the plugin.  They are all user entered (except for the source which is populated by what ever is in Docker Settings - Default appdata)

 

The way to test is that it is logged the exact command used to backup.  Stop all the containers, look at the permissions, run the command and look at the permissions after its complete.

 

Link to comment

umm.. I remember seeing the default destination path was something along the line of \mnt\user\CA**Appdata***.

What you've described is exactly how I tested.  I did in the following step.
1. create test folder

2. verify test folder is root

3. run backup using backup now button. wait for it to complete

4. check test folder ownership. and confirm it has changed to nobody.

 

1.thumb.png.8ef43c5f0417f39d3a21143765b49594.png2.thumb.png.b7966880117a18754f3fc6eb66bab813.png

 

in this case, test folder is zzz.  as you can see the owner was changed in a short amount of time, after running backup.


oh well.. i'm lost for word.. I understand if it can't be reproduced, it'll be difficult to reproduce.  I've migrated my mariadb and nextcloud container to use linuxserver.io so PUID and PGID can be set so it is not longer of an issue even with the ownership change.

Link to comment

So I think I did something absolutely stupid. I ran a backup after my cache drive seemed to have been dying it ran fine but I had changed the backup path to something new as to not over write the last one completed back on 1/17. Well now doing so and replacing my cache drive with a new one I noticed that the restore appdata tab shows that there are no backup sets found. Please tell me there is a way to restore from my previously completed backup to this new cache drive. 

Thanks

Link to comment
1 hour ago, Hypner said:

So I think I did something absolutely stupid. I ran a backup after my cache drive seemed to have been dying it ran fine but I had changed the backup path to something new as to not over write the last one completed back on 1/17. Well now doing so and replacing my cache drive with a new one I noticed that the restore appdata tab shows that there are no backup sets found. Please tell me there is a way to restore from my previously completed backup to this new cache drive. 

Thanks

Have you located the "old" backup? You should be able to change the backup location to the old location, re-load the plugin and then see your original backup.  

Link to comment
26 minutes ago, dja said:

Have you located the "old" backup? You should be able to change the backup location to the old location, re-load the plugin and then see your original backup.  

Yes I still have the backup that I want and have located it. What do you mean re-load the plugin then? I actually did try and change the location which was fine but when I go back to the tab for restore appdata it still shows that there is nothing to choose from. The Restore button is not greyed out but it states "

This will restore your appdata folder from /mnt/user/backups/undefined to /mnt/user/appdata/"

 

Link to comment
7 minutes ago, Hypner said:

Yes I still have the backup that I want and have located it. What do you mean re-load the plugin then? I actually did try and change the location which was fine but when I go back to the tab for restore appdata it still shows that there is nothing to choose from. The Restore button is not greyed out but it states "

This will restore your appdata folder from /mnt/user/backups/undefined to /mnt/user/appdata/"

 

By reload I just meant to hit F5 on the page just to reload it. If you are absolutely sure you know the original location I would back it up before doing anything further. Double check the pass that you have configured for the plug-in to make sure that it's actually looking at the correct folder and not one above it and then change the path to where you think it should be pointed, hit save and apply and hit F5 to reload the page you should see a new available backup appear. If not, you may want to post a directory listing so that we could take a look at it and see what might be going on. Just the directory for where the backup is.

Link to comment
16 hours ago, dja said:

By reload I just meant to hit F5 on the page just to reload it. If you are absolutely sure you know the original location I would back it up before doing anything further. Double check the pass that you have configured for the plug-in to make sure that it's actually looking at the correct folder and not one above it and then change the path to where you think it should be pointed, hit save and apply and hit F5 to reload the page you should see a new available backup appear. If not, you may want to post a directory listing so that we could take a look at it and see what might be going on. Just the directory for where the backup is.

So I tried this and it worked great. I was confused at first as it actually showed the backup file in the restore tab and then when I left that tab and came back it was no longer and option to restore from. But clicking restore even without something showing still allowed me to backup from that file since the path was correct. Many thanks as things are back up and running. 

  • Like 1
Link to comment

I've been trying to search this topic without much luck. I'd like to run this plug-in. I'd sort of a Unraid rookie. I have an appdata share and when I look at its contents I don't see folders for every docker I'm running. When I edit each docker and look around, I see I have appdata folders "spread around." So a few questions come up.

 

If I do nothing, with this plug-in find the appdata folders for each docker and back them up regardless of their location?

 

Do I need to fix this appdata location problem? If so, is the only solution re-installing each docker while paying more attention to where the appdata folder end up?

Link to comment
  • Squid locked this topic
Guest
This topic is now closed to further replies.