How to make files in a Linux folder with default group write permission

I have a folder called backups. The root places the backups in this folder. I want all the files created in this folder to have permission to write to the group.

I know that I can use umask, but I want to know what will work with uumask for all files anywhere or will work in a specific folder.

e, g i want umask just for the / backups folder not elsewhere

+7
bash shell
source share
1 answer

One possibility is to use access control lists . A file system containing /backups must be mounted with the acl option. Then give access to the group that should have it:

 setfacl -d -Rm group:backup-group:rwx /backups setfacl -Rm group:backup-group:rwx /backups 

All subsequently created files and directories under /backups will be written to backup-group if the backup program does not explicitly use restrictive permissions (if it stores any archive files, you will be fine, but if it is, for example, rsync saving permissions, which will not be executed).

Another possible option is to use bindfs to provide a view /backups (mounted elsewhere) with different permissions.

+5
source share

All Articles