Is there a way to set the permissions of log files (unraid docker install)

None of the template stuff seemed to be relevant so I just deleted it all.

I have Rclone installed as a docker container on Unraid, but the issue I am having is that the log files being created do not open when I try and open them from a windows PC (via network share). Says I don't have the correct permissions.

Seems its because the logs are rw/r/r when I would need them to be rw/rw/rw. Or alternatively, they are owned by root (which rclone needs to be installed as) but my PC is obviously not logged in as root.

Is there a way to set the log owner/permissions, without having to change the owner of the entire rclone docker container?

The script I'm using (one of them anyway) :

#!/bin/bash
docker exec Rclone-Native-GUI rclone sync /hex/hex-creative/Assets PCloud:Hex-CreativeBackup
--log-level INFO --log-file=/logs/rclone_creative_$(date +%Y%m%d_%H%M%S).log
--exclude '/@eaDir/**'
--links --modify-window=1s --delete-during

I tried adding a
&& chmod 777 /mnt/user/appdata/rclone/logs/*.log

to the script in order to change all logs to the right permissions, but it only happens after the sync has finished (which is no use to me). I need to be able to create the log file and have it have the right permissions straight away.

This is not really rclone problem... but basic Linux permissions stuff.

There are many ways how you can "fix it", for example:

Set the setgid bit of the logs directory, so that files/folder under will be created with the same group as

chmod g+s <directory>

Set the default ACLs for the group and other

setfacl -d -m g::rwx /<directory>
setfacl -d -m o::rx /<directory>

And add user you use to access it to the correct group.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.