Jump to content

Guide: Unraid Server Backups Using LuckyBackup


Recommended Posts

@ich777

I just noticed this in the template settings for the luckyBackup container:

Screenshot2024-08-11090220.png.39ee8894182a3c61d3569609224a02d4.png

 

Shouldn't these vars be PUID and PGID? All other containers I've ever used, these vars have the P in front. Could that maybe be cause the UNKNOWN owner issue? Basically, the owner isn't being set?

Still, I can see how this might affect the copies LB makes, but not the originals. I have no clue. 😄 

Link to comment
33 minutes ago, Mattaton said:

Other than screenshots, is there a better way to share my LB settings with you?

No.


 

16 minutes ago, Mattaton said:

Shouldn't these vars be PUID and PGID?

Why?

I don‘t use portable ones, PID and GID is correct for my container other than this won‘t change ther permissions.

 

16 minutes ago, Mattaton said:

Basically, the owner isn't being set?

Sure, UID=nobody and not UNKNOWN.

 

How or better speaking where did you mount the host files to the container?

 

You know that you can mount the host files as read only too…?

 

Are you really sure that nothing isn‘t misconfigured on your set up?

 

I backup my whole server with luckyBackup and it doesn‘t change any permissions/users/file attributes.

Link to comment
2 minutes ago, ich777 said:

No.


 

Why?

I don‘t use portable ones, PID and GID is correct for my container other than this won‘t change ther permissions.

 

Sure, UID=nobody and not UNKNOWN.

 

How or better speaking where did you mount the host files to the container?

 

You know that you can mount the host files as read only too…?

 

Are you really sure that nothing isn‘t misconfigured on your set up?

 

I backup my whole server with luckyBackup and it doesn‘t change any permissions/users/file attributes.

I really have no idea if something is misconfigured or what that might be. Most things seem to be fine. Owner isn't being randomly changed by the owning containers. For instance, if images upload to immich, the folders and images have the correct owner/permissions.

 

BUT...I did just run the tiredofit db-backup container that backs up my mariadb dbs. I watched the folder where it backs up to. All files and folders were set to nobody, then it ran and all files and folders were set to UNKOWN. But not in the Immich folder. The db-backup container has no access to the Immich folder. So that's not what is causing the owner to change there.

But it does speak to some sort of issue somewhere that is unrelated to LB. But what? If other containers aren't changing owner settings, it can't be an issue across the board. Immich also uses 99 and 100, but the owner stays nobody. So it's not something like the user IDs on my machine are fouled up.

 

Here's my LB container settings (I will at the least take your advice to set the host files to read-only):

Screenshot2024-08-11092820.thumb.png.91d074eb9e5bbffff9f85ba441afd5f9.png

Link to comment

Okay. I did a test and running the LB task is changing the owner on at least one folder and I can reproduce the outcome every time.

 

With the host folder set to read-only, I get errors in the log. I assume because it wants to write the .luckybackup-snaphots (incidentally, those folders are misspelled. Missing the S in shots 🙂 ) folder to the source?

Not a big deal as long as it backs up. So, just for testing, I switched the host directory back to read/write.

 

I set owner:nobody on the entire folder to be backed up. I run LB backup task and come back and the files have the correct user, but all the folders keep being switched to UNKNOWN every time I run the task.

But, it does not set the owner to UNKNOWN on the destination (maybe because all the files are already synced and it has nothing to write to the destination).

 

I posted a separate thread on the unRAID forum to see if I can get somebody that knows more to give me some insight as to why this could be happening. I don't think it's just a LB thing. Obviously the db-backup container is doing it too.

 

Before LB run:

Screenshot2024-08-11103759.png.f981374109775eeeae4b0796243a8f5b.png

 

After:

Screenshot2024-08-11103820.png.b56697b883c0c001ebacf64428efffc1.png

Edited by Mattaton
Link to comment

Sorry to keep bothering you, @ich777

I got the db-backup container working correctly. I tested and it was doing the owner switch on my home and work servers. So it wasn't a server specific issue. Turns out it had missing user and group variables I could add into the template. Now it works correctly and doesn't change the owner when it runs.

 

So I'm down to only luckBackup doing this. Is there something in the luckyBackup task setups that could cause this? It's been a while since I set them up, but I thought I did it per your recommendations/instructions. 

Kinda scratching my head on this one. I don't want to have to drop back to rsync scripts or research something like borgmatic. 😕 

 

Link to comment
12 minutes ago, Mattaton said:

So I'm down to only luckBackup doing this. Is there something in the luckyBackup task setups that could cause this? It's been a while since I set them up, but I thought I did it per your recommendations/instructions. 

I really don't know because you still haven't posted any screenshots from your sync settings, maybe but I really doubt it.

What filesystem is the backup on? You said it changed the files on the source but the screenshots show the backup destination.

 

As said above I use luckyBackup for backing up my whole Main server to another server and I never had such an issue (please note that I have Read and Write permissions on like it is the case for the default configuration).

You are also the first user who reports such an issue.

Link to comment

Had the same problem with db-backup backups getting synced, once he's set the permissions right (and possibly disabling the "latest" symlinks, I believe that was my problem back then) it should be fine, i.e. not related to LB.

Link to comment
16 minutes ago, Kilrah said:

Had the same problem with db-backup backups getting synced, once he's set the permissions right (and possibly disabling the "latest" symlinks, I believe that was my problem back then) it should be fine, i.e. not related to LB.

Hello again, @Kilrah 😊

Can you elaborate on what I need to look at? Adding the user ID and group ID vars to db backup was the fix there, but Lucky Backup already has vars for that.

I agree with you and @ich777 that this is a problem on my end and not with Lucky Backup. I am grateful for whatever insight you can provide.

Thanks!!!

Link to comment
26 minutes ago, ich777 said:

I really don't know because you still haven't posted any screenshots from your sync settings, maybe but I really doubt it.

What filesystem is the backup on? You said it changed the files on the source but the screenshots show the backup destination.

 

As said above I use luckyBackup for backing up my whole Main server to another server and I never had such an issue (please note that I have Read and Write permissions on like it is the case for the default configuration).

You are also the first user who reports such an issue.

I'll post screenshots of my LB settings when I get back to my PC.

The screenshots I posted previously are of the source. It's in the backup folder because that's where the database backups are stored. Then LB syncs the backups to another server. So, even though it says it's in the backup folder, it's the source folder for LB.

Link to comment
13 minutes ago, Mattaton said:

I'll post screenshots of my LB settings when I get back to my PC.

 

may upload your profile files instead

 

image.png.2f912eca60bb72de9be999dabe8bad85.png

 

especially the one/s which includes the jobs which are causing this

 

im also backing up servre/s using luckybackup and can say it never changed anything on the source ...

  • Like 1
Link to comment

Okay. I've attached the profile for these tasks.

 

@Kilrah I wanted to point out, I have this issue on all folders that LuckyBackup backs up. Not just the ones that db-backup also has access to.

For example, my Vaultwarden backup folder is not touched by db-backup, but when I sync that folder to the remote server with LB, the Vaultwarden folder and all folders within are changed to owner UNKNOWN (including the .luckybackup-snaphots folder that LB controls). See images below (before/after LB run).

Does this same thing on all folders that LB syncs, including my Immich folder (which is the live folder used by the immich container and not a backup that is just synced to the other server).

 

I can make the volume read-only to LB, but if I do that, it can't write to the .luckybackup-snaphots folder.

 

Screenshot2024-08-12141316.png.7b36e18ba818905708751f21be259dc0.png

Screenshot2024-08-12141430.thumb.png.09e847eecee0d0980be18bc6cce592e9.png

 

daily.profile

Link to comment
40 minutes ago, Mattaton said:

I can make the volume read-only to LB, but if I do that, it can't write to the .luckybackup-snaphots folder.

Wait, the .luckybackup-snapshots should be in the destination not in the source...

 

You have set up a sync not a backup task:

TypeSync=1

 

You have to use this option:
grafik.thumb.png.5762c1e5ac79a39f46f3d0bd7f996696.png

 

A sync will always sync the two servers and will not Backup them, I think that is your main issues (by default it is set to Backup Source inside Destination).

This was also a thing because I wanted a screenshot of your settings because it would be pretty obvious in the screenshot too...

Link to comment
12 minutes ago, ich777 said:

Wait, the .luckybackup-snapshots should be in the destination not in the source...

 

You have set up a sync not a backup task:

TypeSync=1

 

You have to use this option:
grafik.thumb.png.5762c1e5ac79a39f46f3d0bd7f996696.png

 

A sync will always sync the two servers and will not Backup them, I think that is your main issues (by default it is set to Backup Source inside Destination).

This was also a thing because I wanted a screenshot of your settings because it would be pretty obvious in the screenshot too...

Okay?

But isn't sync a viable option if I want the destination to have on it exactly what the source has on it? So if a file is removed from the source, I also want it to be removed from the destination. Is a sync not the way to do that?

Basically, I want a duplicate of the backup on the source on the destination.

 

Wait, I see what you mean. If I were to add a file onto the destination, it would copy it onto the source. BAD. I don't monkey with the destination, so this has not been an issue. But I can see how it could be.

 

I assume you aren't saying this is the reason that the owner is changing, right? Like, if someone were to use sync (and mean to) the owner shouldn't change on the "source" side, right?

Edited by Mattaton
Link to comment
8 minutes ago, Mattaton said:

But isn't sync a viable option if I want the destination to have on it exactly what the source has on it? So if a file is removed from the source, I also want it to be removed from the destination. Is a sync not the way to do that?

Sorry but that is not what a sync does, a sync does synchronize the two servers.

To explain that a bit more in detail rsync will create a list of all files on both servers, then compares the files between the servers and syncs the files from Server A to B which are missing and also syncs the files from Server B to A which are missing, so that you have both directories exactly the same but that could also lead to old files being synced back from Server B to A.

 

You want to use a backup task because you only want to sync new files from Server A to B and delete old files which are not existent on Server A anymore.

 

Sync:

Purpose: The primary goal of sync is to ensure that two directories (source and destination) contain the same files.

 

Backup:

Purpose: The main aim of a backup task is to create a copy of files in another location for safekeeping, without necessarily making the destination identical to the source.

 

 

8 minutes ago, Mattaton said:

I assume you aren't saying this is the reason that the owner is changing, right?

It's most likely the case why your permissions are changing in the source, the source should never be touched, that's why I always recommend to use a Backup since your goal is to have a backup.

  • Like 2
  • Thanks 1
Link to comment
1 minute ago, ich777 said:

Sorry but that is not what a sync does, a sync does synchronize the two servers.

To explain that a bit more in detail rsync will create a list of all files on both servers, then compares the files between the servers and syncs the files from Server A to B which are missing and also syncs the files from Server B to A which are missing, so that you have both directories exactly the same but that could also lead to old files being synced back from Server B to A.

 

You want to use a backup task because you only want to sync new files from Server A to B and delete old files which are not existent on Server A anymore.

 

Sync:

Purpose: The primary goal of sync is to ensure that two directories (source and destination) contain the same files.

 

Backup:

Purpose: The main aim of a backup task is to create a copy of files in another location for safekeeping, without necessarily making the destination identical to the source.

 

 

It's most likely the case why your permissions are changing.

Gotcha. I think you were replying while I was editing my reply with my "oh wait, I see what you're saying... 😄 

I'm on the same page with you now!

 

This answers so many questions as to why my script to backup and keep only 14 backups wasn't working. As soon as the sync ran, it copied all the "backups" from the destination back to the source. Ugh.

I was trying to treat sync like a mirror. Sync the source to the destination, but not thinking about it syncing the destination back to the source. I think it was the terms source and destination that got me. Seems one-directional.

 

I just ran a test, and of course, if it's now only pulling from the source it doesn't have to change anything.

 

Still though, and a total sidenote as you have me sorted: If someone did want to use sync, why would the owner get changed on the source side?

 

THANKS!!!

Link to comment
19 minutes ago, Mattaton said:

Still though, and a total sidenote as you have me sorted: If someone did want to use sync, why would the owner get changed on the source side?

I don't know, that shouldn't happen in theory but I never tried that, I can only tell you that if I look into my Backup folder the users and groups are correct.

Usually the UID and GID should be the same on both systems 99:100 (for most files/folders).

Link to comment
Just now, ich777 said:

I don't know, that shouldn't happen in theory but I never tried that, I can only tell you that if I look into my Backup folder the users and groups are correct.

Usually the UID and GID should be the same on both systems 99:100 (for most files/folders).

Yep. That's how it's been for me. I think the destination side only ended up with the UNKNOWN after the source had been changed and then another sync operation ran which updated the destination with the UNKNOWN owner. In my testing over the last few days, only the source side was changing.

 

Complete side note again - remember back when we were trying to get the cron job to run at a certain time and it was 6 hours or so off when it ran, even though the cron text looked correct? I wanted it to run at 5am and I would have to set it at 11pm to get that to happen.
Another user (I forget the name offhand) was having the same problem and added a file to the config to alter the timezone or something. But you said you didn't like that way of doing it and wanted to devise another way. Did that ever go anywhere or should I still offset the scheduled time?

 

THANKS!

Link to comment
5 minutes ago, Mattaton said:

UNKNOWN

I still think that is a configuration error from rsync since you should have a UID and GID.

 

5 minutes ago, Mattaton said:

Complete side note again

TBH, this is not the correct thread for this conversation since the Support Thread is here (it's also linked when you click on the container icon and Support).

 

We have now more than one full page of support (in the wrong thread) which would be simply be solved if you have posted a screenshot from your configuration earlier.

Link to comment
3 minutes ago, ich777 said:

I still think that is a configuration error from rsync since you should have a UID and GID.

 

TBH, this is not the correct thread for this conversation since the Support Thread is here (it's also linked when you click on the container icon and Support).

Absolutely. Sorry. I just realized this when looking back through the thread for that old conversation when @cybrnook replied to tell me to continue the discussion in the support thread. 🙂 

Apologies for starting this topic here as well. I just searched for LuckyBackup in the forum and this one popped up and seemed familiar.

Feel free to delete all this to keep this thread clean.

Edited by Mattaton
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.

×
×
  • Create New...