您好,登錄后才能下訂單哦!
這篇文章主要講解了“怎么實現服務器中的文件差異備份”,文中的講解內容簡單清晰,易于學習與理解,下面請大家跟著小編的思路慢慢深入,一起來研究和學習“怎么實現服務器中的文件差異備份”吧!
使用小巧強大的7z(不到1M),實現差異文件備份.
::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
感謝各位的閱讀,以上就是“怎么實現服務器中的文件差異備份”的內容了,經過本文的學習后,相信大家對怎么實現服務器中的文件差異備份這一問題有了更深刻的體會,具體使用情況還需要大家實踐驗證。這里是億速云,小編將為大家推送更多相關知識點的文章,歡迎關注!
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。