0

Firstly, we wanna move the changes from one system to another system and for this, we have a shell script in synchfolders.sh file as follows

rsync -av --delete -e 'sshpass -p Wordpress@123 ssh -p 22' root@192.168.2.94:/var/www/html/prosync/wp-content/plugins/ /var/www/html/devsync/wp-content/plugins >> /var/www/html/devsync/wp-content/mysynclog.txt

and we want to execute this shell script in PHP file by shell_exec() and while executing this PHP file from a browser other than rsync command, all are executing but the rsync is not executing. We have searched the stuff in SO and we got the link php exec() rsync ssh to remote server not working as said here, we have tried the PHP file execution from the command line and works perfect but not through the browser. Why, Please let us know where we did a mistake. Thanks in advance

1 Answers1

0

Enter the full path of rsync command:

/usr/bin/rsync -av --delete -e 'sshpass -p Wordpress@123 ssh -p 22' root@192.168.2.94:/var/www/html/prosync/wp-content/plugins/ /var/www/html/devsync/wp-content/plugins >> /var/www/html/devsync/wp-content/mysynclog.txt
fauez
  • 19
  • 2
  • We have tried this one to sir, but this one too working by running php script through the command line but not from the browser.Please suggest us the right way to achieve this – Nagaraju Chimmani May 24 '19 at 04:15