Solved

Dos command to compress a large text file using zip or rar

Posted on 2006-06-18
12
861 Views
Last Modified: 2008-01-16
my batch file has the commands:

set Filename=DATABASE_%date:~-4%%date:~-7,2%%date:~-10,2%.sql
c:\mysql\bin\mysqldump -u root mydb > %Filename%

This creates a backup file each day. The files are over 100mb so disk space is disappearing fast. When I zip the file it shrinks to only several mb. This is more manageable, so how do I automate winzip or winrar to archive and delete the file?

Thanks


0
Comment
Question by:craigdev
  • 3
  • 2
  • 2
  • +4
12 Comments
 
LVL 95

Assisted Solution

by:Lee W, MVP
Lee W, MVP earned 100 total points
ID: 16931871
Frankly, I use the free InfoZip "zip.exe" command - that would simply be:

zip -9 %filename%.zip %filename%

based on your example
http://www.info-zip.org/
0
 
LVL 10

Assisted Solution

by:GuruGary
GuruGary earned 50 total points
ID: 16931873
If you have the registered version of WinZip Pro, it does support a command-line interface that is quite powerful.  You can download it from http://www.winzip.com/prodpagecl.htm, and the command line would probably be something like:

set Filename=DATABASE_%date:~-4%%date:~-7,2%%date:~-10,2%.sql
c:\mysql\bin\mysqldump -u root mydb > %Filename%
wzzip.exe -a DATABASE_%date:~-4%%date:~-7,2%%date:~-10,2%.zip %Filename%
0
 
LVL 14

Expert Comment

by:Hamidreza Vakilian
ID: 16937200
Hi!

You can use PKware Utility for ms-dos.
(Both PKZIP and PKUNZIP)

{
PKZIP -& -rp A:DIR
PKUNZIP -d A:DIR
}

HRV
0
 
LVL 95

Expert Comment

by:Lee W, MVP
ID: 16937243
PKZIP is NOT free - that's why I recommend infozip, which is. Also, the 16 bit pkzip program has limitations and the newer one from PKWare is a time limited trial.
0
 
LVL 14

Expert Comment

by:Hamidreza Vakilian
ID: 16940458
I don't think so... just take a look at the web-site I mentioned above....
0
Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 95

Expert Comment

by:Lee W, MVP
ID: 16940475
I'm very familiar with pkzip 2.04g.  It is NOT free - it IS shareware - click on the manual - at the top it CLEARLY states it is shareware.  In addition, it's 16 bit (no consumer OS was 32 bit when PKZIP was released).
0
 
LVL 14

Expert Comment

by:cwwkie
ID: 16944528
> I'm very familiar with pkzip 2.04g.  It is NOT free - it IS shareware

I agree with that. I have even doubts if the link is completely legal.
It includes for example Turbo Pascal 5.5. But this is not freeware! It is free of charge, but still copyrighted. It is very clearly stated that "These files may not be made available via the Internet or any hard copy media" (see http://bdn.borland.com/article/20803)
0
 
LVL 6

Expert Comment

by:dotENG
ID: 16948965
0
 
LVL 14

Accepted Solution

by:
FriarTuk earned 100 total points
ID: 16951516
winrar u d:\test.rar -inul -os -ow -r -x*.rar c:\*.*

  u             update & add
filename
  inul         Disable all messages
  os          Save NTFS streams
  ow         Save or restore file owner and group
  r             Recurse subdirectories
  x<file>   Exclude specified file = *.rar
path = c:\*.*
0
 
LVL 4

Expert Comment

by:mctigue
ID: 16992465
You could try drvspace in your config.sys
Pkzip might also work.
You could also cut the space it takes up in half by making it only backup every other day.
0
 
LVL 14

Expert Comment

by:FriarTuk
ID: 16998394
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

The following is a collection of cases for strange behaviour when using advanced techniques in DOS batch files. You should have some basic experience in batch "programming", as I'm assuming some knowledge and not further explain the basics. For some…
YESTERDAY YESTERDAY.BAT is inspired by a previous article I wrote entitled: TOMORROW.BAT (http://www.experts-exchange.com/OS/Microsoft_Operating_Systems/MS_DOS/A_4196-Advanced-Batch-File-Programming-TOMORROW-BAT.html). The crux of this batch f…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now