SIMULATION -
Who ever creates the files/directories on archive group owner should be automatically should be the same group owner of archive.
SIMULATION -
Who ever creates the files/directories on archive group owner should be automatically should be the same group owner of archive.
To ensure that any user who creates files or directories within the 'archive' directory automatically sets the group owner to match the group owner of the 'archive' directory, you need to set the SGID (Set Group ID) bit on the directory. The correct command to achieve this is 'chmod g+s /archive'. This command sets the SGID bit, causing new files and directories to inherit the group ownership of the parent directory. After setting this, you can verify the permissions by running 'ls -ld /archive', which should show a permission string similar to 'drwxrws---', indicating that the SGID bit is set (the 's' in the group permission field).
#Create a Directory mkdir archive #Set the GUID chmod g+s archive Now any file or folder created in the archive will have the same owner:group permissions as parent folder, in this case same as archive folder
Say we got data dir under home, so: chmod g+s data tar cvf backup.tar data