Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Batch scripts that automatically back up mssql server databases and compress them

2025-03-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

This article introduces the relevant knowledge of "realizing automatic backup of mssql server database and compressed batch script". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

The copy code is as follows:

@ ECHO ON set dongs% daterius 0Magnesia 10% set dudes% dvubs% set tweets% timeparts 0cover8% set tweets% tours% tours% set stamp=%p%%d%%t% set bakupfolder=F:\ backup\ rem 1 saves backup files by subdirectory 0 do not press set lay_in_subfolder=1 call: backupone foo call: backupone foo2 call: backupone foo3 call: backupone foo4 goto: EOF @ ECHO OFF: backupone setlocal echo% 1 set dbname=%1 if not exist% bakupfolder%%dbname% mkdir% bakupfolder%%dbname% if% lay_in_subfolder%==1 (set subfolder=%dbname%\) else set subfolder= rem echo% bakupfolder%%subfolder%%dbname%%stamp%.bak sqlcmd-U sa-P "sa"-S localhost-Q "backup database% dbname% to disk='%bakupfolder % subfolder%%dbname%%stamp%.bak' "" C:\ Program Files\ WinRAR\ RAR.exe "a-ep1-r-o +-M5-s-df"% bakupfolder%%subfolder%%dbname%%stamp% ".rar"% bakupfolder%%subfolder%%dbname%%stamp%.bak "endlocal&goto: EOF" batch script for automatic backup of mssql server database and compression "ends here Thank you for your reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 212

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report