File mode of data backup files

NethServer Version: 7.5
Module: backup-data

There’s no such thing as too many backups… My Neth server backs up to an NFS share on my FreeNAS box, and I’m wanting to back that up to a remote cloud share. Up to this point, I’ve been running rclone manually as root, which works but is pretty tedious. I’ve just installed Duplicati in a jail on the FreeNAS box, and it looks like it should do nicely. But since it runs as its own non-privileged user, I’m running into permissions problems.

The NFS share is owned by nobody:nogroup, so everything written there has that ownership as well. The backup-data script appears to create everything with a mode of 600, so it can only be read by its owner. That means that unless I run Duplicati as nobody, it can’t read the files. What I’d like to do is have the file mode at 640, and use a group that the Duplicati user belongs to. The alternative, I guess, would be to change that share ownership to the same as the Duplicati user.

Is there any way to change permissions on the backup files without just editing the backup-data script?

What about a post-backup script with chmod -R 640 /mnt/backup, just an idea…not tested.