1. 程式人生 > >用WinRAR自動備份檔案

用WinRAR自動備份檔案

my_bak.bat檔案:

 

@echo off

set RARCMD=c:/progra~1/winrar/winrar.exe a -ep1 -m0 -ag /r /k /s /ibck
set files=D:/backup/rar

if not exist "D:/backup/rar" md "D:/backup/rar"

set filename=md2_client_server
echo "正在備份資料[%filename%]..."
%RARCMD% %files%/%filename% @D:/backup/bin/%filename%.list


echo "備份完成,清理臨時檔案"
rmdir /S /Q d:/db
echo "清理完成"

exit

 

md2_client_server.list

E:\data\md2_client
E:\data\md2_server
E:\data\md2_common
E:\data\md2_script

配合計劃任務,可以實現自動備份