EvoTalk

31 一月, 2007

Windows下定時備份 SVN DB 至網路主機空間

Posted by: asd In: Code Snippet| Script| 程式設計 ()

自已的 notebook 不是 24 小時都開著,利用排程等午休睡覺的時間或晚餐的時間開始壓縮後上傳。使用上傳程式 ncftpput,用法參考 FTP Client - ncftp

CODE:
  1. @echo off
  2. path=%path%;"c:\program files\winrar"
  3. :rar
  4. set tyear=%date:~0,4%
  5. set tmon=%date:~5,2%
  6. set tday=%date:~8,2%
  7. set SVN=SVN-%tyear%-%tmon%-%tday%.rar
  8. echo "Backup SVN %SVN%"
  9. rar a -r "D:\%SVN%" D:\Code\SVN\*.*
  10. echo "Upload to HostMonster FTP Server"
  11. :ftp
  12. ncftpput -u 帳號 -p 密碼 xxx.xxx.xxx.xxx pfn/webhd/SVN D:\%SVN%
  13. del D:\%SVN%

Tags: ,

Releated Posts



2 Responses to "Windows下定時備份 SVN DB 至網路主機空間"

1 | Neo

八月 7th, 2009 at 1:10

Avatar

不好意思, 在 google 的帶領下, 不小心找到這裡來.
我也算老手, 但看了您的 script 後...感覺真的是層次差很多.

不知道可不可以請教您.....
我使用 Gmail Drive..作為備份空間....
但 gmail drive 只能用 copy & paste 的方式複製檔案.
或者使用 傳送到(sendto)的方式, 將檔案送到 Gmail Drive 去.
請問...使用 script 或者 bat 可行嗎?

2 | asd

八月 10th, 2009 at 19:16

Avatar

需要搭配 send email command ,可以用 blat或是內建的vbscript
參考這一篇「請問有沒有再dos command模式下寄出檔案的辦法

Comment Form


  • BK: 大於和小於在今日更廣泛地使用於標籤上,故在此補充該英文用法: : angle bracket []: square bracket
  • luh1688: 非常實用且謝謝!~
  • asd: 好的,不過很久沒修改了,不知道能不能動 寄到您的yahoo信箱
  • LIANG: nice post, thank you
  • Justmaker: 您好,請問可以跟你要source嗎?我最近有在看股票,想要enhance您的小工具,不知是否可以開放?

Category