標籤:
1.pscp 命令介紹 ,只需要把此檔案拷到系統目錄對應的system32中,就可以查相看應的說明,如下所示
PuTTY Secure Copy client
Release 0.67
Usage: pscp [options] [[email protected]]host:source target
       pscp [options] source [source...] [[email protected]]host:target
       pscp [options] -ls [[email protected]]host:filespec
Options:
  -V        print version information and exit
  -pgpfp    print PGP key fingerprints and exit
  -p        preserve file attributes
  -q        quiet, don‘t show statistics
  -r        copy directories recursively
  -v        show verbose messages
  -load sessname  Load settings from saved session
  -P port   connect to specified port
  -l user   connect with specified username
  -pw passw login with specified password
  -1 -2     force use of particular SSH protocol version
  -4 -6     force use of IPv4 or IPv6
  -C        enable compression
  -i key    private key file for user authentication
  -noagent  disable use of Pageant
  -agent    enable use of Pageant
  -hostkey aa:bb:cc:...
            manually specify a host key (may be repeated)
  -batch    disable all interactive prompts
  -unsafe   allow server-side wildcards (DANGEROUS)
  -sftp     force use of SFTP protocol
  -scp      force use of SCP protocol
  -sshlog file
  -sshrawlog file
           log protocol details to a file
2.案例
---做了四個cmd檔案,三個放到c盤目錄下,只需要雙擊一下task.cmd,由於服務本身有備份作業, 
--為了備份最新的一份資料,單獨做的備份作業,備份檔案名相同 
---task.cmd 
schtasks /delete /tn "autosave1" /F 
schtasks /delete /tn "autosave2" /F 
schtasks /delete /tn "autosave3" /F 
schtasks /create /sc MONTHLY /d 13 /st 01:05:00 /tn "autosave1" /tr c:\auto_save11.cmd 
schtasks /create /sc MONTHLY /d 13 /st 02:05:00 /tn "autosave2" /tr c:\auto_save12.cmd 
schtasks /create /sc MONTHLY /d 13 /st 02:50:00 /tn "autosave3" /tr c:\auto_save13.cmd 
--auto_save11.cmd 證明伺服器的資料,由於是雙機,只能備兩份資料,拷linux中已備份資料到應急伺服器 --現用,可以改成漂移地址的,由於現用,也就沒有再改 
pscp  -v -q -batch -l root -pw pwdroot 192.6.1.21:/home/oralcedata/backup.tgz e:\dbbak\21 
pscp  -v -q -batch -l root -pw pwdroot 192.6.1.22:/home/oracle/data/backup.tgz e:\dbbak\22 
--auto_save12.cmd 拷貝另一伺服器映射的資料到應急伺服器
 @title 正在備份請勿關閉 
@echo. 檔案比較大,時間比較長,請謹慎操作 
@copy Z:\data.dump d:\dbbak 
--auto_save13.cmd 拷貝應急伺服器的備份到移動硬碟上,應急伺服器,移動硬碟兩份資料加伺服器本身資料庫共三份資料
 @title 正在備份請勿關閉 @echo. 檔案比較大,時間比較長,請謹慎操作
 @xcopy /Y /S e:\dbbak\* F:\最新備份
 
異地備份——windows 與 linux