Reputation: 1
I've been searching on the Internet for last week but I haven't found anything. I have such a problem: We have daily SQL backups in company starting from 2012 up to today. All those files are "compressed" using standard disk compression.
It's about ~500 files per month. It's about 24 000 files. It's huge amount of disks space (every day cost about 9 gb now, 6 gb in 2012). And it's backup, so have those files in three different places.
I want to 7z those files, because, for example, if database have 2 gb, after Windows disk compression feature it has ~1200 mb. When I 7z this file, it has 200 mb.
I've made simple batch script that decompress those files, pack them and delete. After one day it has done one month. Decompressing cost much time.
I see ziping sql BAK files is very common and safe. But now the real question is - do I have to decompress each file, and then pack it, or is it safe to 7z "compressed" files?
Here is the script:
echo off
FOR /R %%i IN (*.bak) DO (
echo Decompressing %%i
compact /u "%%i" >> log.txt
ping 127.0.0.1 -n 2 > nul
echo Zipping %%i
"C:\Program Files\7-Zip\7z.exe" a "%%i.7z" "%%i" >> log.txt
echo Deleting %%i
del "%%i" >> log.txt
echo _____)
Upvotes: 0
Views: 2146
Reputation: 29062
It is perfectly safe.
The compression provided by Windows is transparent. This means that from the perspective of any application, those are just normal files which can be read from and written to like any other file. Internally, Windows compresses and uncompresses the data on the fly one layer below what is visible to applications.
Therefore, 7-Zip will make no difference between files already compressed by Windows and others. However it probably won't make much sense to use Windows' compression anymore if you immediately uncompress them afterwards anyway. It will probably be a lot faster then as well, because even when you don't manually uncompress the files, Windows implicitly has to uncompress the data when 7-Zip wants to read it.
Upvotes: 2