欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

discuzX2全站自动备份批处理

程序员文章站 2022-03-22 09:37:09
复制代码 代码如下:@echo off echo 开始备份本站重要数据! xcopy "d:\web\yunsafe.com\wwwroot\*.*" "d:\web\yu...
复制代码 代码如下:

@echo off
echo 开始备份本站重要数据!
xcopy "d:\web\yunsafe.com\wwwroot\*.*" "d:\web\yunsafe.com\bak\bakup%date:~0,10%\wwwroot\" /i /q
xcopy "d:\web\yunsafe.com\wwwroot\api" "d:\web\yunsafe.com\bak\bakup%date:~0,10%\wwwroot\api\" /e /i /q
xcopy "d:\web\yunsafe.com\wwwroot\archiver" "d:\web\yunsafe.com\bak\bakup%date:~0,10%\wwwroot\archiver\" /e /i /q
xcopy "d:\web\yunsafe.com\wwwroot\config" "d:\web\yunsafe.com\bak\bakup%date:~0,10%\wwwroot\config\" /e /i /q
xcopy "d:\web\yunsafe.com\wwwroot\data" "d:\web\yunsafe.com\bak\bakup%date:~0,10%\wwwroot\data\" /e /i /q
xcopy "d:\web\yunsafe.com\wwwroot\install" "d:\web\yunsafe.com\bak\bakup%date:~0,10%\wwwroot\install\" /e /i /q
xcopy "d:\web\yunsafe.com\wwwroot\rewrite" "d:\web\yunsafe.com\bak\bakup%date:~0,10%\wwwroot\rewrite\" /e /i /q
xcopy "d:\web\yunsafe.com\wwwroot\source" "d:\web\yunsafe.com\bak\bakup%date:~0,10%\wwwroot\source\" /e /i /q
xcopy "d:\web\yunsafe.com\wwwroot\static" "d:\web\yunsafe.com\bak\bakup%date:~0,10%\wwwroot\static\" /e /i /q
xcopy "d:\web\yunsafe.com\wwwroot\template" "d:\web\yunsafe.com\bak\bakup%date:~0,10%\wwwroot\template\" /e /i /q
xcopy "d:\web\yunsafe.com\wwwroot\uc_client" "d:\web\yunsafe.com\bak\bakup%date:~0,10%\wwwroot\uc_client\" /e /i /q
xcopy "d:\web\yunsafe.com\wwwroot\uc_server" "d:\web\yunsafe.com\bak\bakup%date:~0,10%\wwwroot\uc_server\" /e /i /q
echo 本站重要数据备份完成!

echo 开始备份本站mysql数据库!
xcopy "d:\program files\mysql\mysql server 5.1\data\yafan" "d:\web\yunsafe.com\bak\bakup%date:~0,10%\mysqldata\yafan\" /e /i /q
echo 数据库备份完成!

echo 开始打包所有数据!
cd d:\web\yunsafe.com\bak
"c:\program files\winrar\rar.exe" a -k -r -s -m1 -inul "d:\web\yunsafe.com\bak\bakup%date:~0,10%.rar" bakup%date:~0,10%
echo 打包所有数据完成!
exit