[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

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

Posted on 2006-06-18
12
Medium Priority
?
916 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 15

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
 [eBook] Windows Nano Server

Download this FREE eBook and learn all you need to get started with Windows Nano Server, including deployment options, remote management
and troubleshooting tips and tricks

 
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 15

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

TOMORROW TOMORROW.BAT is inspired by a question I get asked over and over again; that is, "How can I use batch file commands to obtain tomorrow's date?" The crux of this batch file revolves around the XCOPY command - a technique I discovered w…
Being a system administrator some time we require to do things remotely, one of them is installing software. Here I am going to tell you how to install software through wmic (Windows management instrument console). I am not at all saying that this i…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
Suggested Courses

650 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