VFP 愛用者社區 首頁 VFP 愛用者社區
本討論區為 Visual Foxpro 愛用者經驗交流的地方, 請多多利用"搜尋"的功能, 先查看看有無前例可循, 如果還有不懂的再發問. 部份主題有附加檔案, 須先註冊成為社區居民才可以下載.
 
 常見問題常見問題   搜尋搜尋   會員列表會員列表   會員群組會員群組   會員註冊會員註冊 
 個人資料個人資料   登入檢查您的私人訊息登入檢查您的私人訊息   登入登入

分享:使用vfp備份SQL的資料檔至異地的電腦,設定自動排程

 
發表新主題   回覆主題    VFP 愛用者社區 首頁 -> VFP 討論區
上一篇主題 :: 下一篇主題  
發表人 內容
CPS0204



註冊時間: 2014-08-24
文章: 441


第 1 樓

發表發表於: 星期三 二月 26, 2020 1:04 pm    文章主題: 分享:使用vfp備份SQL的資料檔至異地的電腦,設定自動排程 引言回覆

異地定義:不同公司或工廠或IP

原本的動作為:
A.SQL SERVER(甲) 設排程自動備份成.BAK
B.透過WINDOWS 自動排程,呼叫RAR壓縮此BAK
C.透過WINDOWS自動排程呼叫 FTP (DOS的指令),寫入異地FTP SERVER中
困擾點:為第C點,因為路由器或不知原因,DOS窗的指令,傳送到一半就會死機或跳出
(或許無法設定TIMOUT的延長秒數有關,超過100mb容量就會死機)
**************************************
SOLUTION:
1.找備份端的隨便一台PC,裝WIN7專業版,安裝SQLserver2014 180天免費板本,開通PORT至路由器,使外部IP可以透過(1433-1434)連入此SQL SERVER (乙),新增一個database,再新增一個小table,兩個欄位:公司名 char(10),rar備份檔 TEXT


2.由各原公司的WIN-SERVER呼叫上面(A+B)兩個動作

3.寫一支VFP的程式放在原公司SERVER中,設定好TIMER ,定期將此RAR讀如VFP中再寫入遠方的ODBC的SQL SERVER (乙)中,24小時執行此EXE,可於凌晨2:00上傳至SQL SERVER(乙)

4.然後寫一支VFP在電腦乙中,定時TIMER於 3:00 從 SQLSERVER(乙)中讀出至 放至 D:\隨意磁蝶目路中\年月日的備份檔.RAR

5.以上試過多家公司備份至 電腦乙中,都沒有問題,每個公司有一條RECORD!
6.檔案大小不拘,當然太大的RAR,傳比較慢,但是不會中斷!,可穿透路由器,解決被檔的風險!
註:VFP程式有用到 讀檔FILETOSTR ,及 轉檔出COPY MEMO YOUR_FILEDS TO D:\XXXX.RAR ,透過ODBC及SPT 等技巧
使用180天免費版是因為不想花錢,到期後移除在重裝一次即可!可再用180天
回頂端
檢視會員個人資料 發送私人訊息
goodnight



註冊時間: 2008-10-13
文章: 472
來自: 台南市

第 2 樓

發表發表於: 星期三 二月 26, 2020 4:32 pm    文章主題: 引言回覆

參考 cobian backup
建好 FTP server , 剩下的交給備份程式

現在可以考慮如何放到雲端硬碟了
https://www.example-code.com/foxpro/googleDrive.asp
https://www.cdata.com/kb/tech/googledrive-odbc-foxpro.rst
有看沒有懂

_________________
希望有更多人來參與
VFP wiki - 需要大家一起完成的VFP電子書與FAQ
回頂端
檢視會員個人資料 發送私人訊息 發送電子郵件 雅虎訊息通 MSN Messenger
yctsai



註冊時間: 2003-04-11
文章: 179


第 3 樓

發表發表於: 星期三 二月 26, 2020 9:07 pm    文章主題: 引言回覆

用backup and sync from google 省事多了
回頂端
檢視會員個人資料 發送私人訊息
goodnight



註冊時間: 2008-10-13
文章: 472
來自: 台南市

第 4 樓

發表發表於: 星期四 二月 27, 2020 1:30 pm    文章主題: 引言回覆

yctsai 寫到:
用backup and sync from google 省事多了


我忘了, 還有這個

_________________
希望有更多人來參與
VFP wiki - 需要大家一起完成的VFP電子書與FAQ
回頂端
檢視會員個人資料 發送私人訊息 發送電子郵件 雅虎訊息通 MSN Messenger
CPS0204



註冊時間: 2014-08-24
文章: 441


第 5 樓

發表發表於: 星期五 二月 28, 2020 6:54 am    文章主題: 引言回覆

backup and sync from google也可以
但我其他分公司的server被路由器給檔了(連dos 的ftp排程都檔),也有些在大陸的server無法翻牆

還是用我的方法最佳,不會被任何人擋
回頂端
檢視會員個人資料 發送私人訊息
sken



註冊時間: 2004-02-17
文章: 67


第 6 樓

發表發表於: 星期二 三月 03, 2020 7:06 pm    文章主題: 引言回覆

goodnight 寫到:
參考 cobian backup
建好 FTP server , 剩下的交給備份程式

現在可以考慮如何放到雲端硬碟了
https://www.example-code.com/foxpro/googleDrive.asp
https://www.cdata.com/kb/tech/googledrive-odbc-foxpro.rst
有看沒有懂


我也推薦 cobian backup 做異地備份,免費好用
回頂端
檢視會員個人資料 發送私人訊息
goodnight



註冊時間: 2008-10-13
文章: 472
來自: 台南市

第 7 樓

發表發表於: 星期二 三月 31, 2020 8:48 am    文章主題: 引言回覆

ftp 協定還是有可能被鎖, 用 http 協定可能方便一點, 架一個 hfs , 然後下指令
我本身並沒有使用過這樣的方式, 請自行研究

這是補充說明, 經過昨天一下午的測試, 我個人是失敗了, 不知道是不是我測試的環境不標準, 我是架了 hfs

參考資料
http://rejetto.com/forum/index.php?pretty;board=hfs-~-http-file-server;topic=upload-with-filename-inside-url.msg1042258#msg1042258


以下是比較完整的解說資訊, 由網友 rxr 說明的方法
Sure was a fight to get this posted!
Hope it has not double (or triple) post!

Poster "yu le" asked a good question and deserves an answer. I'm not an expert in this area but here is what I found....

I suggest you read up on a program called "curl" at this web site: http://curl.haxx.se/
And here is a link on this forum on the subject: http://www.rejetto.com/forum/index.php?topic=6463.0
I've tried what was suggested and it worked for me (the HFS folder was set to allow any users to upload, no login):

curl -F fileupload1=@MyFile.iso -F press="Upload files" http://<HFSipaddress>/<HFSfolder>/

Now here is a brief cut and past from the curl manual (with some examples) to provide more insight:

curl is a tool to transfer data from or to a server, using one of the supported protocols (HTTP, HTTPS, FTP, FTPS, SCP, SFTP, TFTP, DICT, TELNET, LDAP or FILE). The command is designed to work without user interaction.

Curl Option:

-F/--form <name=content>

(HTTP) This lets curl emulate a filled-in form in which a user has pressed the submit button. This causes curl to POST data using the Content-Type multipart/form-data according to RFC1867. This enables uploading of binary files etc. To force the 'content' part to be a file, prefix the file name with an @ sign. To just get the content part from a file, prefix the file name with the symbol <. The difference between @ and < is then that @ makes a file get attached in the post as a file upload, while the < makes a text field and just get the contents for that text field from a file.

Example, to send your password file to the server, where 'password' is the name of the form-field to which /etc/passwd will be the input:
curl -F password=@/etc/passwd www.mypasswords.com

To read the file's content from stdin instead of a file, use - where the file name should've been. This goes for both @ and < constructs.

You can also tell curl what Content-Type to use by using 'type=', in a manner similar to:

curl -F "web=@index.html;type=text/html" url.com
--or--
curl -F "name=daniel;type=text/foo" url.com

You can also explicitly change the name field of an file upload part by setting filename=, like this:

curl -F "file=@localfile;filename=nameinpost" url.com

See further examples and details in the Curl MANUAL.

-----------------

Ok, now I'd also like to point out a few other things on how to do this (based on what I found via Google)...

It seems it is possible to construct HTTP POST request via Java, VBA, etc... or even plain old text files.
You can do more Googling to find out more about the HTTP protocol and the POST method (along with GET, etc... methods defined in the HTTP protocol syntax, but the fact is you can just telnet to a port an http server is listening to and feed it commands in the correct format and it will work just like a browser does). Here are some links of interest I found via Googling ...

Basic Http Protocol explained: http://en.kioskea.net/contents/internet/http.php3

More on subject the http protocol that shows some good examples of just "cat" ing a text file of http syntax via pipe into a telnet session can be found at this link: http://www.foureleven.org/art/art_netcat.html

(Note: Those interested might want to research the subject of "netcat" as that might be of use itself, but be aware that some AntiVirus software thinks it is a virus).

Ok, that should be enough info for anybody to get a start on this!

By the way, I've been able to get HFS server to work in WinPE 2.0 from the WAIK (the free version of Vista from Microsoft). HFS server combined with curl inside a VistaPE (with a GUI desktop windows manager like LiteStep) and your on your way to a nice rescue/recovery/setup LiveCD., I've been able to get HFS server to work in WinPE 2.0 from the WAIK (the free version of Vista from Microsoft). HFS server combined with curl inside a VistaPE (with a GUI desktop windows manager like LiteStep) and your on your way to a nice rescue/recovery/setup LiveCD.

Hoped this helped some.

_________________
希望有更多人來參與
VFP wiki - 需要大家一起完成的VFP電子書與FAQ
回頂端
檢視會員個人資料 發送私人訊息 發送電子郵件 雅虎訊息通 MSN Messenger
goodnight



註冊時間: 2008-10-13
文章: 472
來自: 台南市

第 8 樓

發表發表於: 星期三 四月 01, 2020 11:33 am    文章主題: 引言回覆

今天完成測試, 已經成功下載文件
我覺得在主機安裝 HFS, 再讓其他主機執行排定服, 直接以 COMMAND 下載檔案會比較好, 因為 HTTP 上傳的動作複雜多了

curl 提供的功能很強, 但我都不太會用, 呵呵呵

download
CURL --user user:password -o <filename> http://ip/dir/

upload 是使用 post , 所以要看一下上傳表單的 html 碼
upload
curl --user user:password --form file=@locfilename --form file=Upload http://ip/dir/

以上測試環境以 HFS 軟體為主

_________________
希望有更多人來參與
VFP wiki - 需要大家一起完成的VFP電子書與FAQ


goodnight 在 星期三 四月 01, 2020 1:34 pm 作了第 1 次修改
回頂端
檢視會員個人資料 發送私人訊息 發送電子郵件 雅虎訊息通 MSN Messenger
chilin



註冊時間: 2003-10-01
文章: 79
來自: Taipei,Taiwan

第 9 樓

發表發表於: 星期三 四月 01, 2020 12:17 pm    文章主題: 引言回覆

ssh + rsync
rsync:遠端同步備份,網路中斷還可續傳

_________________
一個喜愛Latte的男人
回頂端
檢視會員個人資料 發送私人訊息 參觀發表人的個人網站
goodnight



註冊時間: 2008-10-13
文章: 472
來自: 台南市

第 10 樓

發表發表於: 星期三 四月 01, 2020 12:20 pm    文章主題: 引言回覆

chilin 寫到:
ssh + rsync
rsync:遠端同步備份,網路中斷還可續傳


現在不知道開版的版主環境為何, 只能提供網路比較不受限制的餿主意給他
比較不受限的就是透過 http 了, 其他 TCP 協定比較會受限制

_________________
希望有更多人來參與
VFP wiki - 需要大家一起完成的VFP電子書與FAQ
回頂端
檢視會員個人資料 發送私人訊息 發送電子郵件 雅虎訊息通 MSN Messenger
chilin



註冊時間: 2003-10-01
文章: 79
來自: Taipei,Taiwan

第 11 樓

發表發表於: 星期二 四月 07, 2020 10:27 am    文章主題: 引言回覆

windows環境可以使用 ssh for win32 + rsync for win32
不過 http + curl 也可以,只要能達到目的就是OK!

_________________
一個喜愛Latte的男人
回頂端
檢視會員個人資料 發送私人訊息 參觀發表人的個人網站
CPS0204



註冊時間: 2014-08-24
文章: 441


第 12 樓

發表發表於: 星期三 四月 08, 2020 3:26 pm    文章主題: 引言回覆

[ 現在不知道開版的版主環境為何, ]
ans: 此server被封AD 了HTTP,只剩下FTP可用 .......只能走FTP,跟MIS人員要求打開,就是不肯
所以只能走FTP (DOS窗的不行,傳到一半會中斷)
或是自行設計 SQL穿透備份傳檔案!
該死的AD,什麼都收回權限,沒有最高授權,跟本很難作業!
還有大陸端的傳回台灣會被檢查封包!
回頂端
檢視會員個人資料 發送私人訊息
ezpos



註冊時間: 2011-04-20
文章: 323


第 13 樓

發表發表於: 星期五 六月 05, 2020 1:05 pm    文章主題: 引言回覆

CPS0204 寫到:
[ 現在不知道開版的版主環境為何, ]
ans: 此server被封AD 了HTTP,只剩下FTP可用 .......只能走FTP,跟MIS人員要求打開,就是不肯
所以只能走FTP (DOS窗的不行,傳到一半會中斷)
或是自行設計 SQL穿透備份傳檔案!
該死的AD,什麼都收回權限,沒有最高授權,跟本很難作業!
還有大陸端的傳回台灣會被檢查封包!


可以把檔案 拆小點上傳....

_________________
ezPos收銀機 簡單好用低成本 http://www.ezpos.info
全新美觀的POS收銀機.POS軟硬體耗材.
軟體客制化.網站規劃....能賺錢的都可以找我

http://www.twelife.com 台灣生活網
回頂端
檢視會員個人資料 發送私人訊息 參觀發表人的個人網站
CPS0204



註冊時間: 2014-08-24
文章: 441


第 14 樓

發表發表於: 星期一 六月 08, 2020 4:01 pm    文章主題: 引言回覆

此方法已不用了,雖可行但麻煩
已改用網友建議的 cobian backup ,很好用,可以穿透公司的AD,因為走的是 FTP!
回頂端
檢視會員個人資料 發送私人訊息
從之前的文章開始顯示:   
發表新主題   回覆主題    VFP 愛用者社區 首頁 -> VFP 討論區 所有的時間均為 台北時間 (GMT + 8 小時)
1頁(共1頁)

 
前往:  
無法 在這個版面發表文章
無法 在這個版面回覆文章
無法 在這個版面編輯文章
無法 在這個版面刪除文章
無法 在這個版面進行投票
無法 在這個版面附加檔案
無法 在這個版面下載檔案


Powered by phpBB © 2001, 2005 phpBB Group
正體中文語系由 phpbb-tw 維護製作