Solved

How to schedule a job that compresses files by modify or access time using GZIP

Posted on 2006-06-15
4
420 Views
Last Modified: 2010-04-13
Once a month I go into my file server and run GZIP to compress files that are older than one month. I would like to know how to write a batch file that will compress by modify date or access time. Any help would be much appriciated.

Thansk
0
Comment
Question by:AAMNetop
4 Comments
 
LVL 1

Accepted Solution

by:
orestyle1 earned 125 total points
ID: 16916069
We are using PKZIP from the command line.  Seems to work best when running batch files as you can pass paramaters to pkzip from the batch.  I would assume you could specify the greater than less then option within the batch file to get this done.  I would get PKZIP and go through the documentation.  

http://www.pkware.com/business_and_developers/compression/dos/ 

This is the link to their site.  I must say that unzipping and zipping files in a batch file was the easiest when using pkzip as you can specify different commands right in the command.  I am not really sure how to specify the date range, but this should get you in the right direction.  
0
 
LVL 7

Assisted Solution

by:life_j
life_j earned 125 total points
ID: 16917038
You can create  a log file of the modified dates on a folder
Say you have a root folder by name Backup
then

c:\backup\dir > modifieddate.log

This would give a list of all the files and folders which have been modified.
You can use a for loop to check if the file or folder is older then a month and zip the file.

As per scripting. I would ask you to put a pointer in the programming.Who would be able to implement this idea.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Restore SQL database from 8.0 to 11.00 ? 3 1,162
Windows 7 7 258
Closing cmd window after script execution 4 254
windows explorer 21 172
NTFS file system has been developed by Microsoft that is widely used by Windows NT operating system and its advanced versions. It is the mostly used over FAT file system as it provides superior features like reliability, security, storage, efficienc…
In 2017, ransomware will become so virulent and widespread that if you aren’t a victim yourself, you will know someone who is.
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

911 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

23 Experts available now in Live!

Get 1:1 Help Now