duanchui1955 2019-05-22 04:01
浏览 288

在Web浏览器上从php文件执行rsync shell命令

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条回答 默认 最新

  • douyi1982 2019-05-22 19:40
    关注

    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
    
    评论

报告相同问题?

悬赏问题

  • ¥15 素材场景中光线烘焙后灯光失效
  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 保护模式-系统加载-段寄存器