I have two users in a group.
Users:
1) apache
2) data
Group
1) apache
I have three directories. The directory structure of that three directories are like below.
drwxrwx--- 10 data apache 4096 Aug 21 14:30 Data
drwxrwx--- 10 data apache 4096 Aug 21 14:30 App
drwxrwx--- 22 apache apache 4096 Aug 22 12:04 www
I have a copy program in App
directory. It will copy a file from Data
directory to www
directory. After the copy process over, the copied file are in the mode of below.
----r----- 1 apache apache 35003 Aug 22 11:47 wT89TQsATjE.txt
But I want to be that file permission as like below after the copy process.
-rw-rw---- 1 apache apache 35003 Aug 22 11:47 wT89TQsATjE.txt
Could I change the mod of the file to be read as user and group after that copy process automatically?