File permissions changes after backup script runs?


je82

Recommended Posts

Hi,

 

I've noticed that my file/folder permissions keep changing whenever my cron rsync scripts run.

 

/mnt/user/Backup ls -l

image.png.35fc99831bdc5d522b3d6ef57f43518f.png

 

While /mnt/user0/Backup ls -l

image.png.cf9e1106cb0a0744c51c42e1e269a817.png

 

Sometimes inside "Files\ Backup/" folders are now owned by user "sshd"

image.png.99bfb87e201785e7bd53a1c81de943cb.png

Any idea what i am doing wrong or why this is occuring?

 

The backup jobs are simple rsync jobs, any idea what i need to change to have the permissions not change? Thanks.

Edited by je82
Link to comment
1 hour ago, je82 said:

Any idea what i am doing wrong or why this is occuring?

What are the scripts that you're running; how are you invoking rsync? Are they run by the root user? What are the ownerships and permissions on the original files that are being backed up? Do the first two screen grabs show the situation before and after running the scripts or not. If not then the difference could be explained by the fact that the /mnt/user0 path excludes the cache disk or pool from the union, while /mnt/user includes it. In which case, what does "ls -l /mnt/cache" look like?

Link to comment
18 minutes ago, John_M said:

What are the scripts that you're running; how are you invoking rsync? Are they run by the root user? What are the ownerships and permissions on the original files that are being backed up? Do the first two screen grabs show the situation before and after running the scripts or not. If not then the difference could be explained by the fact that the /mnt/user0 path excludes the cache disk or pool from the union, while /mnt/user includes it. In which case, what does "ls -l /mnt/cache" look like?

The rsync script is invoked as root, it then sends the files to another unraid server.

The permission in /mnt/user/Backup was looking like the permissions in /mnt/user0/Backup before the rsync script ran.

 

I have multiple different scripts backing up to the /Backup folder, there are windows machines running FreeFileSync daily to send files to /Backup/Files\ Backup/ but whenever the rsync script has ran the windows machine credentials no longer have read access to the /Backup folder, i've ran the the "Fix Permissions" thing on the Backup share multiple times and i've narrowed it down to the rsync script doing something with the permissions everytime.

 

Cache permissions seems fine

 

image.png.4aef15b164694f46fce26b4c0ca6a7a2.png

Edited by je82
Link to comment
  • 6 months later...
On 9/20/2020 at 8:42 PM, je82 said:

found the issue, i was running one of the backup scripts as a different user and rsync default tries to clone the permissions

Looks like this wasn't it after all, this issue is so strange, it seems i can't even properly test it because when i do the permissions for folderd don't change, then a few weeks of auto running scripts suddenly the folders have changed permissions again, i have no idea what is causing this but its driving me insane because when it happens my backups can't run because folders are not writable.

 

An example of it happening now is:

 

I browse (with explorer UNC Path) \\Backup\Other Backup\  and it works fine.

I decide to create a folder here because i want to add some stuff to this path.

 

When i right click, hit "create new folder" i get a error message that i don't have access to that folder.

Then explorer refreshes and now i suddenly don't have access to browse \\Backup\Other Backup\ anymore.

 

The permissions of \\Backup\Other Backup\ has changed and it appears it changed whenever i tried to create a folder inside this share.

 

Why is this happening? Is this some sort of bug? How can i debugg it properly? I can now restore permissions using unraid tool and it will work, then in a few weeks, perhaps months, it will start screwing folder permissions again out of nowhere.

 

EDIT: Now i ran the command to fix the folder permission of \\Backup\Other Backup\ and i can see the folder i created right before i lost permissions. So i had permissions, the folder was created but the very same second it was created the root folder "Other Backup" changed permissions and kicked me out, why the hell is this happening at random?

 

EDIT: This definitely has to do with the share being "Private". Seems to be a smb bug, sometimes i get connected to the share but when i create a folder rather then crediting the folder creation to the actual user that is logged in it goes to nobody and if the share is private and the folder is set to nobody then the user does not have access. Maybe a bug in unraid or smb who knows but at least now i know what  the issue is

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