ftp自动上传脚本:
======================================
@echo off
set YEAR=%date:~0,4%
set MONTH=%date:~5,2%
set DAY=%date:~8,2%
set TODAY=%YEAR%_%MONTH%_%DAY%
set TARGET_IP=192.168.1.54
set FILE_NAME_PRE=my_backup
set FILE_NAME=%FILE_NAME_PRE%_%TODAY%*bak
echo the file_name is %file_name%
echo user admin > ftp_put_file.txt
echo mypassword >>ftp_put_file.txt
echo cd E:\BACKUP>>ftp_put_file.txt
echo put %FILE_NAME%>>ftp_put_file.txt
echo bye>>ftp_put_file.txt
ftp -s:ftp_put_file.txt -n %TARGET_IP%
===========================================
定期删除6个月以前的数据脚本:
@echo off
set FILE_NAME=my_backup_*bak
forfiles /D -180 /P E:\BACKUP /M my_backup_*bak /C "cmd /c del /Q /S @file"
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/11134237/viewspace-702731/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/11134237/viewspace-702731/