In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
7z.exe is a good thing. Many years ago, I tried all kinds of command-line compression software, but the effect was not good. Not long after 7zip came out, I found that it also had command-line mode. Then I found that the usability was very good, and the compression ratio and efficiency were also very good. At that time, I tried winrar and rar, and the results were not very good.
C:\ 7-Zip\ 7z.exe a-sdel "E:\ Backup\ Zip_%date:~0,4%_%date:~5,2%_%date:~8,2%.7z"E:\ Backup\% date:~0,4%_%date:~5,2%_%date:~8,2%.dmp"E:\ Backup\% date:~0,4%_%date:~5,2%_%date:~8,2%.log" for / F "delims="% I in ('wmic path Win32_LocalTime get day / delims= ^ | find "=" ') do set / a% iif% day%==2 (copy E:\ Backup\ Zip_%date:~0,4%_%date:~5,2%_01.7z E:\ Backup_1stDayOfMonth\) if% day%==16 (copy E:\ Backup\ Zip_%date:~0,4%_%date:~5,2%_15.7z E:\ Backup_1stDayOfMonth\) forfiles / p "E:\ Backup\" / m * .7z-d-30 / c "cmd / c del / f @ path"
Friends who are familiar with Oracle should be able to see that this is Oracle's dump and log file compression. Expdp export dump is very convenient, the disadvantage is that this thing is super large, after using 7zip compression, the capacity can be reduced to about 5%.
You can take a look at the parameters of 7z for yourself. Here are two parameters used in my command line.
A: compression
-sdel: delete the source file after the compression is completed. For dump such a large file, delete after backup, this parameter is very useful.
First path: compressed file name with path
The second and third paths: two file names that need to be compressed. If there is a fourth, fifth, and so on, you can continue to write.
% date:~0,4%%date:~5,2%%date:~8,2% is the date under the command line, and I underlined it in the middle of the year, 2018-01-01.
The second paragraph reads the system date and determines that if the date is 2, the backup of 1 day will be copied to another directory for long-term storage.
In the third paragraph, clean up the expired files in the backup directory.-d represents days, and-30 represents 30 days ago.
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: 0
*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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.