eeolivier
asked on
php, rsync and exec function
I need from a PHP script running ."script.sh" that contain :
SSH_AUTH_SOCK=/tmp/ssh-XXl Fi8Jl/agen t.3825; export SSH_AUTH_SOCK;
SSH_AGENT_PID=3826; export SSH_AGENT_PID;
echo Agent pid 3826;
/usr/bin/rsync --delete -ave ssh /data/AUDIO_FILES/ srv01:/data/AUDIO_FILES/
In my php script :
exec("/home/script.sh 2>&1",$return);
print_r($return) give me :
Array ( [0] => Agent pid 3826 [1] => Could not create directory '/.ssh'. [2] => Host key verification failed. [3] => unexpected EOF in read_timeout )
PLEASE HELP !!
SSH_AUTH_SOCK=/tmp/ssh-XXl
SSH_AGENT_PID=3826; export SSH_AGENT_PID;
echo Agent pid 3826;
/usr/bin/rsync --delete -ave ssh /data/AUDIO_FILES/ srv01:/data/AUDIO_FILES/
In my php script :
exec("/home/script.sh 2>&1",$return);
print_r($return) give me :
Array ( [0] => Agent pid 3826 [1] => Could not create directory '/.ssh'. [2] => Host key verification failed. [3] => unexpected EOF in read_timeout )
PLEASE HELP !!
See http:Q_21108456.html how to setup sudo to work with the webserver user, so you can run that script as root.
ASKER
no, nothing there that can help me
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
yes, that script run perfectly when I run it from the shell as root.
It let me to synchronize files over 5 different servers avec over SSH without having to type password.
When i do vi /etc/sudoers, under root user, i have "read only file".
It let me to synchronize files over 5 different servers avec over SSH without having to type password.
When i do vi /etc/sudoers, under root user, i have "read only file".
ASKER
it was "visudo". I am going to try the tip
ASKER