linux 間定時傳輸檔案

urgel_babay發表於2016-03-01
sftp oracle@182.254.254.252:/data/backup/expdp_back/imuat.Wed.dmp.tar.gz&nbsp;<br /> <br /> [root@fileserver ~]# useradd oracle<br /> [root@fileserver ~]# passwd oracle<br /> [root@fileserver ~]# su - oracle<br /> [oracle@fileserver ~]$ ssh-keygen -t rsa<br /> [oracle@fileserver .ssh]$ ls<br /> id_rsa &nbsp;id_rsa.pub<br /> [oracle@fileserver .ssh]$ chmod 400 id_rsa.pub<br /> <br /> 在對端建立oracle使用者,吧<span style="white-space:normal;">id_rsa.pub傳過去並改名</span>authorized_keys 許可權和讀寫改下<br /> <br /> WDAY=`date +%a`<br /> #設定Mon至Sun的方法<br /> sftp oracle@182.254.244.157:/u01/backup/ora_exp/oasys.${WDAY}.dmp.tar.gz /u01/file/q<br /> sftp oracle@182.254.131.114:/data/backup/expdp_back/imuat.${WDAY}.dmp.tar.gz /u01/file/q<br /> sftp oracle@115.159.103.53:/u01/dbackup/expdp/crmexp.${WDAY}.dmp.tar.gz /u01/file/q<br /> rm -Rf ./u01/file/q/ls.txt<br /> ls -lh &gt;/u01/file/q/ls.txt<br /> cat /u01/file/q/ls.txt | mail -s "Share_server_"`date +%F_%H:%m`"_expdp_trans" itdbagroup@1.2<br /> <br /> 首先windows端安裝cwRsyncServer_4.1.0_Installe,注意修改使用者和密碼,記下來<br /> 然後開啟rsyncd.conf<br /> 修改為<br /> use chroot = false<br /> strict modes = false<br /> hosts allow = *<br /> log file = rsyncd.log<br /> pid file = rsyncd.pid<br /> port = 873--埠最好不要修改<br /> uid = 0<br /> gid = 0<br /> <br /> <br /> # Module definitions<br /> # Remember cygwin naming conventions : c:\work becomes /cygwin/c/work<br /> #<br /> [標記1]--這個注意<br /> path = /cygdrive/c/1--需備份的目錄位置,指的是C盤1資料夾,注意不要加下劃線<br /> read only = yes<br /> transfer logging = yes<br /> <br /> 完成後,在services.msc中啟動rsync,注意修改使用者名稱密碼,設定開機啟動<br /> windows防火牆關閉<br /> linux端,安裝<br /> yum install talnet-server按收藏的網頁設定<br /> vi /u01/passwd<br /> 只要加一行密碼<br /> <br /> rsync -vzrtopg --progress --delete --password-file=/u01/passwd administrator@(ip地址)::標記1 (備份放置目錄)<br /> <br /> <br /> <br /> <br /> <br /> <br /> <br /> <br /> <br /> <br /> <br /> <br /> <br />

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/30936525/viewspace-2018570/,如需轉載,請註明出處,否則將追究法律責任。

相關文章