在Xshell中上傳下載檔案到本地(linux中從多次ssh登入的dbserver裡面的檔案夾)

來源:互聯網
上載者:User

在Xshell中上傳下載檔案到本地(linux中從多次ssh登入的dbserver裡面的檔案夾) 1 列出所有需要copy的sh檔案-bash-4.1$ ll /mysqllog/osw/*.sh-rwxr-xr-x 1 mysql mysql   409 May 16 10:00 /mysqllog/osw/topaix.sh-rwxr-xr-x 1 mysql mysql   127 May 16 10:00 /mysqllog/osw/tarupfiles.sh-rwxr-xr-x 1 mysql mysql   556 May 16 10:00 /mysqllog/osw/stopOSW.sh-rwxr-xr-x 1 mysql mysql  1609 May 16 10:00 /mysqllog/osw/startOSW.sh-rwxr-xr-x 1 mysql mysql   398 May 16 10:00 /mysqllog/osw/oswsub.sh-rwxr-xr-x 1 mysql mysql   330 May 16 10:00 /mysqllog/osw/oswnet.sh-rwxr-xr-x 1 mysql mysql   636 May 16 10:00 /mysqllog/osw/oswlnxtop.sh-rwxr-xr-x 1 mysql mysql   634 May 16 10:00 /mysqllog/osw/oswlnxio.sh-rwxr-xr-x 1 mysql mysql 15598 May 16 10:00 /mysqllog/osw/OSWatcher.sh-rwxr-xr-x 1 mysql mysql  5586 May 16 10:00 /mysqllog/osw/OSWatcherFM.sh-rwxr--r-- 1 mysql mysql   567 May 16 10:00 /mysqllog/osw/mysql_status.sh-rwxr--r-- 1 mysql mysql   617 May 16 10:00 /mysqllog/osw/mysql.sh-rwxr--r-- 1 mysql mysql   587 May 16 10:00 /mysqllog/osw/mysql_inno_status.sh 2 從遠程db伺服器上copy出來sh到控制機器的novamysqladminprod帳號目錄下:2.1 進入osw目錄並且copysh檔案cd /home/novamysqladminprod/cacti/oswscp eanprdnucmydbc027db01.eao.abn-iad.ea.com:/mysqllog/osw/*.sh ./cp * /tmp/osw/  2.2 退出control機器[novamysqladminprod@mydbctl osw]$ exitlogout[chm@mydbctl osw]$ exitlogout[chm@linuxbh1-p osw]$ scp mydbctl.eao.abn-iad.ea.com:/tmp/osw/* /tmp/oswPassword: mysql_inno_status.sh                                                                                                                                         100%  587     0.6KB/s   00:00    mysql.sh                                                                                                                                                     100%  617     0.6KB/s   00:00    mysql_status.sh                                                                                                                                              100%  567     0.6KB/s   00:00    OSWatcherFM.sh                                                                                                                                               100% 5586     5.5KB/s   00:00    OSWatcher.sh                                                                                                                                                 100%   15KB  15.2KB/s   00:00    oswlnxio.sh                                                                                                                                                  100%  634     0.6KB/s   00:00    oswlnxtop.sh                                                                                                                                                 100%  636     0.6KB/s   00:00    oswnet.sh                                                                                                                                                    100%  330     0.3KB/s   00:00    oswsub.sh                                                                                                                                                    100%  398     0.4KB/s   00:00    startOSW.sh                                                                                                                                                  100% 1609     1.6KB/s   00:00    stopOSW.sh                                                                                                                                                   100%  556     0.5KB/s   00:00    tarupfiles.sh                                                                                                                                                100%  127     0.1KB/s   00:00    topaix.sh                                                                                                                                                    100%  409     0.4KB/s   00:00     2.3 check sh files in linuxbh servers[chm@linuxbh1-p osw]$ pwd/tmp/osw[chm@linuxbh1-p osw]$ lltotal 68-rwxr--r-- 1 chm chm   587 Sep  2 08:06 mysql_inno_status.sh-rwxr--r-- 1 chm chm   617 Sep  2 08:06 mysql.sh-rwxr--r-- 1 chm chm   567 Sep  2 08:06 mysql_status.sh-rwxr-xr-x 1 chm chm  5586 Sep  2 08:06 OSWatcherFM.sh-rwxr-xr-x 1 chm chm 15598 Sep  2 08:06 OSWatcher.sh-rwxr-xr-x 1 chm chm   634 Sep  2 08:06 oswlnxio.sh-rwxr-xr-x 1 chm chm   636 Sep  2 08:06 oswlnxtop.sh-rwxr-xr-x 1 chm chm   330 Sep  2 08:06 oswnet.sh-rwxr-xr-x 1 chm chm   398 Sep  2 08:06 oswsub.sh-rwxr-xr-x 1 chm chm  1609 Sep  2 08:06 startOSW.sh-rwxr-xr-x 1 chm chm   556 Sep  2 08:06 stopOSW.sh-rwxr-xr-x 1 chm chm   127 Sep  2 08:06 tarupfiles.sh-rwxr-xr-x 1 chm chm   409 Sep  2 08:06 topaix.sh[chm@linuxbh1-p osw]$ it is ok ,all the sh files are here.  3 copy the sh files to local pc D:\osw\google得到如下協助資訊:XShell上傳與下載檔案命令sz,rzsz  test.log  下載檔案名稱為test.log到本地rz  上傳檔案到遠程伺服器rz  -y 覆蓋已存在檔案我這裡需要用的是sz命令,如所示:  再去本地check sh檔案,已經下載下來了。 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.