backup.bat

set oracle_username="test"
set oracle_password="abc12!^"
set local_tnsname="225_orcl"

set winrar_path="C:/Program Files/WinRAR/"

set path=%path%;%winrar_path%

for /f "tokens=1-4 delims=/ " %%i in ('date /t') do set day=%%j

set url=%oracle_username%/%oracle_password%

if not %local_tnsname% == "" set url=%url%@%local_tnsname%

exp %url% file=%oracle_username%_%day%.dmp log=%oracle_username%_%day%.log

if %errorlevel% == 0 rar a -m5 -df %oracle_username%_%day% %oracle_username%_%day%.dmp %oracle_username%_%day%.log

你可能感兴趣的:(backup)