2006-11-09

[Windows script] backup.bat



:: Author: Alan Lu
:: Date: 2006-11-09
:: Purpose: Backing up one directory by 7-zip compressor.
:: Ref: http://www.microsoft.com/technet/abouttn/flash/tips/tips_053106_2.mspx
:: Usage:
:: $> backup.bat
:: or
:: $> at 03:00 /every:Sunday backup.bat


@echo off
cls


::
:: %workspace% is a directory name where you want backup.
:: Don't forgot modify the %workspace%'s default value.
set workspace=foo

:: Setting environment variables with todoy's date values
for /f "tokens=1-4 delims=/" %%i IN ('date /t') DO (
set year=%%i
set month=%%j
set day=%%k
)

for /f "tokens=1-3 delims=:" %%i IN ('time /t') DO (
set hour=%%i
set minute=%%j
)

7z a -mx=9 "%year%-%month%-%day%-%hour%-%minute%.7z" %workspace%

2 則留言:

Howl 提到...

http://www.microsoft.com/technet/abouttn/flash/tips/tips_053
^^
不能連耶

那個screenshot肯定不是你的
因為你不會用Firefox,你都用Opera....

a2n 提到...

Hey~~ 你太認真了,那根本不是 PrintScreen 的效果,那是用 camera 拍的。

的確不是我的,我去 Flickr 找 CC liscensed 的圖。 :P