LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Transfer files from one user to the next (https://www.linuxquestions.org/questions/programming-9/transfer-files-from-one-user-to-the-next-727673/)

jhyland87 05-21-2009 07:36 PM

Transfer files from one user to the next
 
So, im making a new site where someone can sign up, and makes a new site for them via cpanel, all automatically. They can select what script they want (wordpress for example), and it will make the account, make the db, and make the files in the account.

A base wordpress file structure will be placed in resellers web account.
/home/reseller/wordpress

The new user that just signs up and has an account created, is named newguy (for example)

So I would need /home/reseller/wordpress to transfer its self to /home/newguy/public_html/.

My script is php based, but obviously I cant do much with php, so i will need to make php execute a shell script to do this.

Permissions are giving me a hard time... so do you guys have any advice?

soleilarw 05-22-2009 09:18 AM

Use PHP's system function to do all the tasks you would otherwise do on the commandline or via a bash script. AFAIK there are PHP commands to modify permissions and ownerships, but their scope obviously is bound by the permissions of the user account that owns the PHP script as a process. If all involved files and directories are accessible by Apache's user (either apache or nobody or some user that you configured in httpd.conf), then all can be done in PHP.

Linux Archive


All times are GMT -5. The time now is 12:26 PM.