Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Apache: Users

call rsync from php script

 

 

Apache users RSS feed   Index | Next | Previous | View Threaded


jcxxr at yahoo

May 13, 2008, 2:59 AM

Post #1 of 3 (148 views)
Permalink
call rsync from php script

Hello,

I have a bash script update.sh that contains:
rsync -- delete -avz -e ssh ${files} root[at]64.XXX:/red
when I use that script ./update.sh as root, it works like a charm as I set up the private/public key properly.
When run from a php script through the apache webserver
<?php
exec("update.sh");
?>
The rsync line is ignored.
I
understand that the php script is called under the apache user, when
the private/public key is for my root user. How can I set the the keys
so that the apache user can run fully the php script?

Thank you.


____________________________________________________________________________________
Be a better friend, newshound, and
know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ


christian.folini at post

May 13, 2008, 3:10 AM

Post #2 of 3 (139 views)
Permalink
AW: call rsync from php script [In reply to]

Hi Jean-Christophe,

You need to source the ssh-key agent. I suggest you work with a tool
like keychain.

And please configure some sort of protection/authentication
around your update.sh.

Regs,

Christian

________________________________

Von: Jean-Christophe Roux [mailto:jcxxr[at]yahoo.com]
Gesendet: Dienstag, 13. Mai 2008 11:59
An: users[at]httpd.apache.org
Betreff: [users[at]httpd] call rsync from php script


Hello,

I have a bash script update.sh <http://update.sh/> that contains:
rsync -- delete -avz -e ssh ${files} root[at]64.XXX <mailto:root[at]64.XXX>
:/red
when I use that script ./update.sh as root, it works like a charm as I
set up the private/public key properly.
When run from a php script through the apache webserver
<?php
exec("update.sh <http://update.sh/> ");
?>
The rsync line is ignored.
I understand that the php script is called under the apache user, when
the private/public key is for my root user. How can I set the the keys
so that the apache user can run fully the php script?

Thank you.


daniel at bestningning

May 13, 2008, 7:24 AM

Post #3 of 3 (137 views)
Permalink
Re: call rsync from php script [In reply to]

----- Original Message -----
From: Jean-Christophe Roux
To: users[at]httpd.apache.org
Sent: Tuesday, May 13, 2008 5:59 AM
Subject: [users[at]httpd] call rsync from php script


Hello,

I have a bash script update.sh that contains:
rsync -- delete -avz -e ssh ${files} root[at]64.XXX:/red
when I use that script ./update.sh as root, it works like a charm as I set up the private/public key properly.
When run from a php script through the apache webserver
<?php
exec("update.sh");
?>
The rsync line is ignored.
I understand that the php script is called under the apache user, when the private/public key is for my root user. How can I set the the keys so that the apache user can run fully the php script?

Thank you.






add this line in your /etc/sudoers

apache ALL=(ALL) NOPASSWD:/usr/bin/rsync

and change your rsync command to
sudo rsync -- delete -avz -e ssh ${files} root[at]64.XXX:/red

Apache users RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact lists@gossamer-threads.com
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.