?
Solved

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

Posted on 2006-06-18
12
Medium Priority
?
907 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2
  • +4
12 Comments
 
LVL 96

Assisted Solution

by:Lee W, MVP
Lee W, MVP earned 400 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 200 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
NFR key for Veeam Agent for Linux

Veeam is happy to provide a free NFR license for one year.  It allows for the non‑production use and valid for five workstations and two servers. Veeam Agent for Linux is a simple backup tool for your Linux installations, both on‑premises and in the public cloud.

 
LVL 96

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
 
LVL 96

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 400 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:Stephen 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

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
One of my most closely kept secrets is revealed in this discussion How to output text on the same line This question was recently posted in EE by Simon336697 (http://www.experts-exchange.com/Programming/Languages/Scripting/Shell/Batch/Q_2459…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Suggested Courses

764 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