您好,登錄后才能下訂單哦!
這篇文章主要講解了“怎么實(shí)現(xiàn)服務(wù)器中的文件差異備份”,文中的講解內(nèi)容簡單清晰,易于學(xué)習(xí)與理解,下面請(qǐng)大家跟著小編的思路慢慢深入,一起來研究和學(xué)習(xí)“怎么實(shí)現(xiàn)服務(wù)器中的文件差異備份”吧!
使用小巧強(qiáng)大的7z(不到1M),實(shí)現(xiàn)差異文件備份.
::This script backup the data from srvdatacn01 ::It's an ancremental backups tools, One base file and diff files for each day. ::The files be deleted at srvdatacn01 are still keep saved at archived diff files, until them be deleted. ::Make sure you DateTime format is "yyyy-mm-dd", which could be use as one filenme(exclude / \ * :) ::Add C:\Program Files\7-Zip\ to environment variables path :: Delete the diff archive files which over 7 days :: Command forfiles doesn't support UNC path, so need map the path to driver first if not exist \\srvdatacn02\d ( NET USE Y: \\srvdatacn02\d ) forfiles /P Y: /M backup_srvdatacn01*diff*.zip /C "cmd /c del /q/f @path" /D -7 NET USE Y: /D call :backup "folder1","folder2","folder3","folder4","folder5" :backup for %%i in (%*) do ( if not exist "d:\backup_srvdatacn01_%%~i_base.7z" ( 7z a "d:\backup_srvdatacn01_%%~i_base.7z" "\\srvdatacn01\%%~i\*" -xr!Thumbs.db -mx9 ) else ( 7z u "d:\backup_srvdatacn01_%%~i_base.7z" "\\srvdatacn01\%%~i\*" -u- -up0q1r2x2y2z0w0!"d:\backup_srvdatacn01_%%~i_diff_%date:/=_%_%time::=_%.7z" -xr!Thumbs.db -mx9 7z u "d:\backup_srvdatacn01_%%~i_base.7z" "\\srvdatacn01\%%~i\*" -up0q0r2x2y2z1w1 -xr!Thumbs.db -mx9 ) ) goto:eof
** forfiles 需要使用盤符映射**
forfiles /P Y: /M backup_srvdatacn01*diff*.zip /C "cmd /c del /q/f @path" /D -7
7z u "d:\backup_srvdatacn01_%%~i_base.7z" "\\srvdatacn01\%%~i\*" -u- -up0q1r2x2y2z0w0!"d:\backup_srvdatacn01_%%~i_diff_%date:/=_%_%time::=_%.7z" -xr!Thumbs.db -mx9
7z u "d:\backup_srvdatacn01_%%~i_base.7z" "\\srvdatacn01\%%~i\*" -up0q0r2x2y2z1w1 -xr!Thumbs.db -mx9
感謝各位的閱讀,以上就是“怎么實(shí)現(xiàn)服務(wù)器中的文件差異備份”的內(nèi)容了,經(jīng)過本文的學(xué)習(xí)后,相信大家對(duì)怎么實(shí)現(xiàn)服務(wù)器中的文件差異備份這一問題有了更深刻的體會(huì),具體使用情況還需要大家實(shí)踐驗(yàn)證。這里是億速云,小編將為大家推送更多相關(guān)知識(shí)點(diǎn)的文章,歡迎關(guān)注!
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。