项目文件自动备份及删除
2009-12-08 16:47
423 查看
projects_backup.vbs
=============================
dim oShell,dateFile,cmd
dateFile=cstr(year(now))&right("00" & cstr(month(now)),2)&right("00" & cstr(day(now)),2)
cmd="cmd /c @xcopy E:/projects E:/backup/projects/autoback/"&dateFile&" /s/e/r/i"
set oShell = WScript.CreateObject ("WSCript.shell")
oShell.run cmd,0
set oShell = Nothing
projects_delbackup.vbs
=============================
'60天前的自动del
dim oShell,thedate,cmd,saveDateNum
saveDateNum=-60
set oShell = WScript.CreateObject ("WSCript.shell")
for i=-14 to -1
thedate=dateadd("d",saveDateNum+i,now)
thedate=cstr(year(thedate))&right("00" & cstr(month(thedate)),2)&right("00" & cstr(day(thedate)),2)
on error resume next
cmd="cmd /c @rd E:/backup/projects/autoback/"&thedate&"/ /q/s"
oShell.run cmd,0
next
set oShell = Nothing
=============================
dim oShell,dateFile,cmd
dateFile=cstr(year(now))&right("00" & cstr(month(now)),2)&right("00" & cstr(day(now)),2)
cmd="cmd /c @xcopy E:/projects E:/backup/projects/autoback/"&dateFile&" /s/e/r/i"
set oShell = WScript.CreateObject ("WSCript.shell")
oShell.run cmd,0
set oShell = Nothing
projects_delbackup.vbs
=============================
'60天前的自动del
dim oShell,thedate,cmd,saveDateNum
saveDateNum=-60
set oShell = WScript.CreateObject ("WSCript.shell")
for i=-14 to -1
thedate=dateadd("d",saveDateNum+i,now)
thedate=cstr(year(thedate))&right("00" & cstr(month(thedate)),2)&right("00" & cstr(day(thedate)),2)
on error resume next
cmd="cmd /c @rd E:/backup/projects/autoback/"&thedate&"/ /q/s"
oShell.run cmd,0
next
set oShell = Nothing
相关文章推荐
- window下备份数据库到LinuxFTP服务器上并自动删除7天前数据备份文件
- linux下mysql自动备份数据库与自动删除临时文件
- CentOS Linux自动备份文件到远程FTP服务器并删除指定日期前的备份
- 文件、目录备份及定时自动删除
- Oracle Rman备份脚本与自动删除重复备份文件
- 文件日志自动删除备份
- MyEclipse编译后,classes文件夹下为空2. 3.删除现在的项目,提前设置好编译文件输出路径,重新导入源文件,设置eclipse为保存时编译,然后在保存的时候就可以自动编译了
- 自动删除历史备份的dmp文件
- SQL SERVER 设置自动备份和删除旧的数据库文件
- sql server 用DOS 批处理 自动 定期删除 备份文件 包括完整备份和差异备份
- linux 删除自动备份的文件
- sql server2008R2自动备份和自动删除过期bak文件
- 【转载】SQLServer自动备份和自动删除过期文件
- sqlserver2008自动备份,自动删除较早的别分文件
- 自动删除VC项目目录下临时文件
- window环境下定时备份数据库文件、项目代码并且定期删除
- linux下mysql自动备份数据库与自动删除临时文件
- Sql Server 备份文件管理(自动删除、过期)
- 用批处理文件自动备份文件及文件夹,并自动删除n天前的文件
- (windows)python脚本:自动备份并压缩文件,同时删除过期文件