[Plugin] Appdata.Backup


Recommended Posts

I'd like to create a script to run after the backup has successfully completed. 

The script needs to run only if the backup was successful, then:

 

Empty the `/mnt/user/CommunityApplicationsAppdataBackup/appdata-latest/` folder.

Copy the folder that was just created by the backup tool to the above path.

 

I've not written any scripts before. Does anyone have any example scripts?

Link to comment

Thanks for the reply. I came up with this, seems to work.

 

#!/bin/sh

    # Destination folder that will be cleared and will receive the copied data:
    dest="/mnt/user/backup/CommunityApplicationsAppdataBackup/appdata-latest"

    # The expected path of the source data (for sanity checking)
    src_must_contain="/mnt/user/backup/CommunityApplicationsAppdataBackup/appdata/ab_"

    # Sent arguments: post-run, destination path, true|false (true on backup success, false otherwise)
     
    today=$(date +'%Y-%m-%d_%H%M%S')
    logfile="/mnt/user/backup/CommunityApplicationsAppdataBackup/appdata/port-run-$today.log"


{ # required for logging, see EOF for closing brace.

    src="$2"
    backup_status="$3"

    echo "log: $logfile"
    echo
    echo "params:"
    echo "param 1 = $1"
    echo "param 2 = $2"
    echo "param 3 = $3"
    echo


    if [ $1 != "post-run" ]; then
        echo "ERROR: param 1 not \"post-run\", exiting."
        exit 0
    fi


    # check param indicates the backup was successful:
    if [ $backup_status != "true" ]; then
        echo "ERROR: backup_status is not true, exiting."
        exit 0
    fi


    # check source path contains the expected path:
    if [[ $src != *"$src_must_contain"* ]]; then
        echo "ERROR: src path appears to be at an unexpected location, exiting."
        exit 0
    fi


    # check source is a directory:
    if [ -d $src ]; then
        echo "source: $src"
    else
        echo "ERROR: src is not a directory, exiting."
        exit 0
    fi


    # check destination is a directory:
    if [ -d $dest ]; then
        echo "dest:   $dest"
    else
        echo "ERROR: dest is not a directory, exiting."
        exit 0
    fi


    # empty destination directory:
    rm -rf $dest/*

    echo "Copying src to dest..."
    # copy source to destination
    cp -r $src/ $dest/

    echo
    
    echo
    echo "finished, exiting."
    exit 0
    
} 2>&1 | tee -a $logfile

 

Link to comment

This Error Message is nervous.

 

Event: Appdata Backup
Subject: [AppdataBackup] Warning!
Description: Please check the backup log!
Importance: warning

'/tmp/Nginx-Proxy-Manager-Official/var/log' does NOT exist! Please check your mappings! Skipping it for now.

 

Yes, this is a temp Path, but its the original Path from the Template.

That's what's working when the Docker Container is Running. But actually he is stopped.

 

Can i or you do anything? @KluthR

Edited by Revan335
Link to comment
6 hours ago, clowncracker said:

I want to only keep 4 backups, but the older versions are not getting deleted (5 copies are here).  I want to make sure I have my settings set up correctly:

Delete backups if older than x days:28

 

If you back up once a week, on the 4th week your oldest backup will be 28 days old.

 

28 Days Old is not Older Than 28 Days.  So you end up with 5 weeks of backups, not 4.

 

Try setting it to 27 days.

Link to comment

I'm not sure if this is an issue but I just did my first scheduled backup with this new plugin. And I have VM meta checked as yes. But I couldn't find that or the libvert backed up anywhere in the backups. But as it says VM meta I'd assume it's not backing up the libvert anymore and just the meta data it uses to create the VMs? Either way I want able to find any VM related backup files. But my flash backup was there. 

Link to comment

Hi,

I've set this appdatabackup plugin a couple of month ago, it was working fine until a few backups ago, maybe 2-3weeks.

I get this error, tar verification failed

[30.12.2023 05:13:10][ℹ️][Dropbox-by-otherguy] Stopping Dropbox-by-otherguy... done! (took 10 seconds)
[30.12.2023 05:13:20][ℹ️][Dropbox-by-otherguy] Should NOT backup external volumes, sanitizing them...
[30.12.2023 05:13:20][ℹ️][Dropbox-by-otherguy] Calculated volumes to back up: /mnt/user/appdata/dropbox
[30.12.2023 05:13:20][ℹ️][Dropbox-by-otherguy] Backing up Dropbox-by-otherguy...
[30.12.2023 05:28:07][ℹ️][Dropbox-by-otherguy] Backup created without issues
[30.12.2023 05:28:07][ℹ️][Dropbox-by-otherguy] Verifying backup...
[30.12.2023 05:32:48][][Dropbox-by-otherguy] tar verification failed! Tar said: tar: Removing leading `/' from member names; mnt/user/appdata/dropbox/events/store: Contents differ
[30.12.2023 05:32:48][ℹ️][Dropbox-by-otherguy] Starting Dropbox-by-otherguy... (try #1) done!


all the other containers are backedup properly and succed. Only this one is giving me trouble. 

 

I did sent the error log to the developper, this is the ID "4024f2b1-e1ae-4c4b-b225-5db3bfbbfc99"

Link to comment
On 12/26/2023 at 1:08 AM, Revan335 said:

This Error Message is nervous.

 

Event: Appdata Backup
Subject: [AppdataBackup] Warning!
Description: Please check the backup log!
Importance: warning

'/tmp/Nginx-Proxy-Manager-Official/var/log' does NOT exist! Please check your mappings! Skipping it for now.

 

Yes, this is a temp Path, but its the original Path from the Template.

That's what's working when the Docker Container is Running. But actually he is stopped.

 

Can i or you do anything? @KluthR

Can I or you anything to fix this?

Except for leaving the Docker container running permanently, although it does not run during the backup either, because it is backed up and therefore terminated beforehand.

Link to comment

I'm not sure if this is the correct place for a feature request. I would like to use this plugin to only backup my flash drive. It would be nice to have a global option to skip/disable docker & appdata.

 

Current workaround

  • point app-data to an empty directory
  • turn each docker to "no"

My only concern with this is that every time I install a new docker I need to remember to disable its backup.

Link to comment

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.