• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 919
  • Last Modified:

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

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
craigdev
Asked:
craigdev
  • 3
  • 2
  • 2
  • +4
3 Solutions
 
Lee W, MVPTechnology and Business Process AdvisorCommented:
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
 
GuruGaryCommented:
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
 
Hamidreza VakilianSenior iOS DeveloperCommented:
Hi!

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

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

HRV
0
Configuration Guide and Best Practices

Read the guide to learn how to orchestrate Data ONTAP, create application-consistent backups and enable fast recovery from NetApp storage snapshots. Version 9.5 also contains performance and scalability enhancements to meet the needs of the largest enterprise environments.

 
Lee W, MVPTechnology and Business Process AdvisorCommented:
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
 
Hamidreza VakilianSenior iOS DeveloperCommented:
I don't think so... just take a look at the web-site I mentioned above....
0
 
Lee W, MVPTechnology and Business Process AdvisorCommented:
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
 
cwwkieCommented:
> 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
 
dotENGCommented:
0
 
FriarTukCommented:
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
 
Stephen McTigueAssistant Director of Information TechnologyCommented:
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
 
FriarTukCommented:
0

Featured Post

Get your Disaster Recovery as a Service basics

Disaster Recovery as a Service is one go-to solution that revolutionizes DR planning. Implementing DRaaS could be an efficient process, easily accessible to non-DR experts. Learn about monitoring, testing, executing failovers and failbacks to ensure a "healthy" DR environment.

  • 3
  • 2
  • 2
  • +4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now