2011-11-07

使用 7-zip 壓縮目錄與檔案 (on Windows)

#!/usr/bin/tclsh
#
# This file is used to backup my homepage
#

set backupfile $env(HOME)
append backupfile "\\My Documents"
append backupfile "\\Homepage-"
append backupfile [clock format [clock seconds] -format %Y%m%d]
append backupfile ".7z"

set backupdir $env(HOME)
append backupdir "\\My Documents"
append backupdir "\\public_html"

set fileExist [file exists $backupfile]
if {$fileExist > 0} {
    puts "Now try to remove old backup file."
    file delete $backupfile
}

set var [list 7z a $backupfile $backupdir]
exec {*}$var

puts "Done."

exit

因為在 Windows XP 上也有需要網頁的備份,所以把之前在 Linux 上用的稍微改寫以後就搬過來了。要注意的是,我已經把 7-ZIP 加進去 PATH 環境變數裡了,所以就不用寫絕對路徑,只要寫 7z 就可以了。

2011-07-20

使用 7-zip 壓縮目錄與檔案

#!/usr/bin/tclsh
#
# This file is used to backup my homepage
#

set backupfile $env(HOME)
append backupfile "/Homepage-"
append backupfile [clock format [clock seconds] -format %Y%m%d]
append backupfile ".7z"

set backupdir $env(HOME)
append backupdir "/public_html"

set fileExist [file exists $backupfile]
if {$fileExist > 0} {
    puts "Now try to remove old backup file."
    file delete $backupfile
}

set var [list 7z a $backupfile $backupdir]
exec {*}$var

puts "Done."

使用 7-zip 建立網頁的備份檔案 (on Linux)。

2011-04-10

file command with ActiveTcl 8.6b5

Safe interp and file command with ActiveTcl 8.6b5

我也遇到 ::tcl::mathfunc::maxunknown hidden command "file" 這個錯誤訊息(在使用 ActiveTcl 8.6b5 執行 TclHttpd 的時候),只是在 Windows XP 上遇到,目前看起來應該是 ActiveTcl 8.6b5 的問題。

2011-01-26

tcllib 1.13 is out

2011.01.24,tcllib 釋出了新版 v1.13。

Overview
========
44 new packages in 10 modules
29 changed packages in 24 modules
62 internally changed packages in 11 modules
207 unchanged packages in 79 modules
348 packages, total in 103 modules, total

相關連結:http://sourceforge.net/projects/tcllib/files/tcllib/1.13/