上传脚本:
echo ********************************************************** >>db_bak_logs.txt
date /t >>db_bak_logs.txt
time /t >>db_bak_logs.txt
echo Start backup to \\192.168.10.1\dbbak\ .... >>db_bak_logs.txt
XCOPY E:\data_bak\database \\192.168.10.1\dbbak\database /D /E /F /C /R /Y >>db_bak_logs.txt
echo Backup complete. >>db_bak_logs.txt
date /t >>db_bak_logs.txt
time /t >>db_bak_logs.txt
echo ********************************************************** >>db_bak_logs.txt
删除270天之前的备份文件:
forfiles /P E:\data_bak\ /s /D -270 /C "cmd /c del @file" |