Well, first thank you for your reply. Second Happy new Year.
First of all, how often you create that directory?
You are correct, Not very often. However, this has gotten to be an academic challenge to me at this point. I tried using your creating new group solution and managed to get everything messed up. I ended up with user:group for rick and www-data like:
Code: Select all
rick:x:1000:1001:rick,,,:/home/rick:/bin/bash
www-data:x:33:1001:www-data:/var/www:/usr/sbin/nologin
The 1001 that shows is left over from the 'groupdel ' I did. How do you get rid of the 1001. I t doesn't seem to do anything, it just annoys me!
Anyway, I found this solution.
The working directory is /home/rick/DBases/Dbmysql/contacts2. All files have rick:www-data user:group.
Starting with
no 'reports' directory I create the 'csvData_xxx' file which is created with 'www-data:www-data' user:group and stored in working directory.
Then I run this bash script - sudo ./CSV_perm.sh.
Code: Select all
#!/bin/bash
mkdir -p -v -m 0764 reports
chown -R rick reports
chown -R rick csvData*
chmod -R 0764 csvData*
mv csvData* reports
This creates the 'reports' directory, if it doesn't exist, then changes the 'reports' directory ownership and assigns permissions to the 'reports' directory. Then the same with csvData* file(s) and finally moves the csvData* files to the 'reports' directory. This works very well except for having to run the script file as a separate operation.
I STILL DO NOT UNDERSTAND WHY THIS CAN'T BE DONE IN PHP ALONE!!!
Thanks for helping,
R