dougao1106 2015-03-10 06:10
浏览 141
已采纳

如何将一个服务器的tgz文件复制到另一个Linux服务器?

I have one file example.tgz hosted in one linux server and I want to copy this file (example.tgz) to another linux server.

How can we copy example.tgz file from one server to another server please suggest.

  • 写回答

1条回答 默认 最新

  • dourang8305 2015-03-10 07:00
    关注

    Try This code:

     <?php
      $connection = ssh2_connect('otherserver.com', 22);
      ssh2_auth_password($connection, 'username', 'password');
    
      ssh2_scp_send($connection, '/local/example.tgz', '/remote/example.tgz', 0644);
     ?>
    

    Please run this code from local, it copy example.tgz files into /remote/ folder.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 MCNP里如何定义多个源?
  • ¥20 双层网络上信息-疾病传播
  • ¥50 paddlepaddle pinn
  • ¥20 idea运行测试代码报错问题
  • ¥15 网络监控:网络故障告警通知
  • ¥15 django项目运行报编码错误
  • ¥15 请问这个是什么意思?
  • ¥15 STM32驱动继电器
  • ¥15 Windows server update services
  • ¥15 关于#c语言#的问题:我现在在做一个墨水屏设计,2.9英寸的小屏怎么换4.2英寸大屏