I am running a linux centos server; our php script generates plenty of files in a directory, anything up to 1000 (though too often more).The files in these directories have permissions and ownerships which i need to change.
I have used shell comment for changing the file permission which is working fine but the problem is file increase the directory it will return this message
/bin/sh: /bin/chown: Argument list too long
I understand that this is because the shell is expanding limit so I want to limit the argument count (file count)
I have 2 options
1) I need to write a script which has to list all the files which are created before one month from now. I have used the following comment used but not working
find /var/www/vhosts/domainname.ie/httpdocs/directory/testquotes/test -mtime +1 -exec chown domain.psacln {} \;
2) once we have changed the file permission we need not want to the agreement list how we will limit the files
Kindly Help.