httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Danie Qian" <>
Subject Re: [users@httpd] call rsync from php script
Date Tue, 13 May 2008 14:24:07 GMT
----- Original Message ----- 
  From: Jean-Christophe Roux 
  Sent: Tuesday, May 13, 2008 5:59 AM
  Subject: [users@httpd] call rsync from php script


  I have a bash script that contains:
  rsync -- delete -avz -e ssh ${files} root@64.XXX:/red
  when I use that script ./ 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
  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@64.XXX:/red

View raw message