[Plugin] CA Appdata Backup / Restore v2


Squid

Recommended Posts

5 hours ago, ConnectivIT said:

This is the exact text I have in the "Excluded folders" setting (comma delimited)

 

/mnt/user/appdata/plex/Library/Application Support/Plex Media Server/Metadata,/mnt/user/appdata/plex/Library/Application Support/Plex Media Server/Cache,/mnt/user/appdata/plex/Library/Application Support/Plex Media Server/Media

 

Note that this was typed in to the field, I didn't use the Excluded Folder Browser.

Thank you. It still won't let me type a space. It will let me paste the path in with spaces though. 

Link to comment

I guess this is the right place to ask this.  I backed up my cache drive, appdata, due to a bad drive.  I've replaced the drive and started the array.  D I just noow go to Restore and do a restore?  Then reinstall my dockers one by one?  I'm a little unclear on the step by step process.

 

Any guidance is appreciated

Link to comment

I have noticed what I believe is a bug.

 

 I started out with compression selected.  However, I have decided that I would rather have uncompress backups.  Switching to “no” for compression and saving the setting hasn’t changed anything with new daily backups still compressed.  Suggestions?

Link to comment

in the "Restore" tab, how do I change the Source Directory field? I've tried changing it in the "Backup / Settings" tab but it appears to make no difference. What am I doing wrong?

 

Here I've selected a directory called "2019-12-11-apps"

image.png.2d580abdc03cb6faa7a8609124664de8.png

 

yet under restore the source is showing a different directory

image.png.6dd400cd137ccbedffb5a211132a24db.png

Link to comment
16 minutes ago, Squid said:

The setting you set up according to a backup.   The restore automatically flips stuff around

as per the screenshots, i've changed the "Destination share" field under backup and the change isn't reflected in the restore tab. Maybe I'm misunderstanding the UI somehow, how exactly is it supposed to be used?

Link to comment

Hello, im working on migrating my server from using V1 to V2 of the CA Appdata backup/restore, and after installing the new version the setting tab will not load and i cannot enable the auto backup, also i cant find V1 in the App plugin to continue running my daily backup.. In a bit of pickle. When I click on ca.back2 in the plugins tab it redirects me to the Settings tab but never loads and it always just a black screen. Also i cant find it under settings if i try to navigate there on my own not from the plugins tab. 

Link to comment

I did remove V1 first before installing V2, are you recommending that a reboot might help? I can try that this evening, but my unraid box is the center of my network(virtualized PFsense) and everything so I have to wait until i'm no longer working :) 

Link to comment
On 4/20/2020 at 10:02 AM, dubbly said:

I have noticed what I believe is a bug.

 

 I started out with compression selected.  However, I have decided that I would rather have uncompress backups.  Switching to “no” for compression and saving the setting hasn’t changed anything with new daily backups still compressed.  Suggestions?

 

On 4/20/2020 at 10:34 AM, Squid said:

What's the rsync command it's using? (It's in the syslog)

I just tried this as well, while just setting up some new options and exclusions..

 

With compression OFF, the command is

Using command: cd '/mnt/user/appdata/' && /usr/bin/tar -cvaf '/mnt/user/appdata_backup/[email protected]/CA_backup.tar'

With compression ON, the command is

Using command: cd '/mnt/user/appdata/' && /usr/bin/tar -cvaf '/mnt/user/appdata_backup/[email protected]/CA_backup.tar.gz'

 

So the only difference there is the file extension, but the resulting file size is different.  Uncompressed, 720MB, Compressed, 200MB. 

 

I'm thinking what dubbly meant is that he wants no 'archive' file, but that's probably not the best idea.  Before I excluded Plex/radarr/sonarr image related stuff my backup archive had close to a million files.  You do not want to back up files like that outside of an archive.

 

 

 

 

There's one small thing to change though, here's the log for usb backup:

Apr 28 22:40:22 UNRAID CA Backup/Restore: Backing up USB Flash drive config folder to

in backup.php change line 127 

 

From:  logger("Backing up USB Flash drive config folder to $usbDestination");  backupLog("Backing up USB Flash Drive");

To:     logger("Backing up USB Flash drive config folder to {$backupOptions['usbDestination']}");  backupLog("Backing up USB Flash Drive");

 

I thought my usb backup was not working but it looks like it is working properly.

Edited by Energen
Link to comment

I would like to propose two feature requests. Let me describe the use cases in more detail. Feel free to ask additional questions about both use cases and let me know what you think.

 

Use case 1

 

As a user of the plugin,

I want to schedule the backup right after my server booted,

so my array disks can go back to sleep after the backup is completed

 

  • I backup appdata from a cache drive to the array
  • I start (WOL) and stop (via sleep) my server on different schedules (during the week, weekend), due to rather high energy costs in the EU. Thus, I cannot use the custom cron schedule as it only allows a single cron entry. Using the time presets is likewise not possible.
  • I want to do the backup during the week in the afternoon (where my server starts) and at the weekend in the morning (where my server starts)
  • Possible solutions:
    • (1) add schedule 'At startup of array' as an indicator of booted (similar to the user script plugin)
    • (2) allow multiple cron entries or multiple triggers in general

 

Use case 2

As a user of the plugin,

I want to run a custom script after the backup is done and before the docker containers are restarted,

so I can inject my custom offsite backup

 

  • I perform custom offsite backups from my appdata folder via rclone and gdrive
  • The backup is implemented via a custom user script
  • The script stops the docker container with access to appdata folders and executes the rclone task
  • The feature would allow me to use the docker start/stop mechanism of your plugin, so I can throw away my custom code
  • The feature would allow me to schedule my other backup jobs in accordance with your plugin. Making the backup process more transparent.
    • Example:  The backup job of your plugin triggers when the server is booted (see first use case). It performs the backup of appdata as *.tar(.gz) and the flashdrive as folder to the array. Then the hook is executed, uploads the latest flashdrive backup from the array and the appdata folder from the cache drive to the cloud. Finally your plugin restarts the container.
  • Possible solutions:
    • (1) add a hook script field similar to "Custom stop (start) script" that is executed after the backup is done and before the docker container are restarted

 

 

Is it possible to execute the CA backup plugin with its configuration from a user scripts? Then I would create two user scripts triggering the CA backup having different cron entries. I still would have to duplicate the scripts as the user scripts plugin is also not able to have multiple triggers. But, I would have a workaround. Edit: Found it!

 

/usr/local/emhttp/plugins/ca.backup2/scripts/backup.sh 
/usr/local/emhttp/plugins/ca.backup2/scripts/backup.php # for a blocking call

 

 

 

 

Edited by T0a
formatting
Link to comment
11 minutes ago, Squid said:

It calls the update script to check for and install updates at the time the backup runs

Okay brilliant so setting the following in Auto Update:

image.thumb.png.f7cb151e773f536dcb8d30f49f030d5a.png

 

and then the following in backup:

image.thumb.png.d5b05f60ea0d93e65f900e4307ed74b5.png

 

Will backup every Sunday at 3:05 and once complete trigger an update.

Link to comment
  • 3 weeks later...

Can someone help me with custom cron entry schedule? The first sunday of every month at 3AM, once a month.

 

Is this right cause I think this will just run it every Sunday which is too much...

 

 0 3 * 1-12 0

 

Thanks.

Edited by ramesivi
Link to comment
6 hours ago, ramesivi said:

Can someone help me with custom cron entry schedule? The first sunday of every month at 3AM, once a month.

0 3 * * 0 [[ $(date +%e) -le 7 ]] && 

You  may however get a line logged in the syslog every Sunday when it doesn't run.  Nothing can be done about that if it happens

Link to comment
  • 2 weeks later...

I had to rebuild my boot disk and replace my CACHE drive and am trying to get things back working again. thankfully i have a backup of my appdata with CA BAckup/Restore, but i guess i am not using it right. I have Restored the backup, but none of my docker containers show under the docker tab. what am i doing wrong or what am i missing? 

Link to comment
3 hours ago, prytzen said:

I had to rebuild my boot disk and replace my CACHE drive and am trying to get things back working again. thankfully i have a backup of my appdata with CA BAckup/Restore, but i guess i am not using it right. I have Restored the backup, but none of my docker containers show under the docker tab. what am i doing wrong or what am i missing? 

I have replied on your other thread.

Link to comment
On 5/1/2020 at 7:39 AM, T0a said:

Use case 2

As a user of the plugin,

I want to run a custom script after the backup is done and before the docker containers are restarted,

so I can inject my custom offsite backup

 

  • I perform custom offsite backups from my appdata folder via rclone and gdrive
  • The backup is implemented via a custom user script
  • The script stops the docker container with access to appdata folders and executes the rclone task
  • The feature would allow me to use the docker start/stop mechanism of your plugin, so I can throw away my custom code
  • The feature would allow me to schedule my other backup jobs in accordance with your plugin. Making the backup process more transparent.
    • Example:  The backup job of your plugin triggers when the server is booted (see first use case). It performs the backup of appdata as *.tar(.gz) and the flashdrive as folder to the array. Then the hook is executed, uploads the latest flashdrive backup from the array and the appdata folder from the cache drive to the cloud. Finally your plugin restarts the container.
  • Possible solutions:
    • (1) add a hook script field similar to "Custom stop (start) script" that is executed after the backup is done and before the docker container are restarted

This is implemented in the 2020.05.31 release. You can now specify a script to run before the containers are started.

Edited by Justin B
comment no longer relevant
Link to comment

I recently replaced my dying cache drive and performed a backup/restore using this plugin. Everything seems fine except my Plex libraries are missing. I'm pretty confident I followed all of the instructions correctly. If anyone has experienced this before or has an idea where I may have messed up I would greatly appreciate the help. Thanks.

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