Solved

Auto creating copies of a file, renaming it to current day, generating 7 of these, only keeping last most recent 7 days.

Posted on 2003-11-25
5
244 Views
Last Modified: 2010-04-11
Hi guys/gurus.

I have a file called COMMSLOG.TXT
which is found in c:\EFT.

The file grows large very quickly, so what I would like to do is:

1) Copy the file to a new file called eft_yyyymmdd.txt each day.
2) Delete the COMMSLOG.TXT after the file has been copied.
3) Keep doing the above 2 steps, but only ever keeping the last 7 days of
logs, and deleting older ones.

Create 7 days of files like this for archiving, then automatically ONLY keep
at any one time, 7 days of these files, so on the eighth day, it will delete
the oldest one.

Can someone please explain to me what the following command will do. I dont
understand the for and tokens, delims part.

for /f "tokens=2-4 delims=/ " %%a in ('DATE/T') do SET date=%%c-%%a-%%b

Any help greatly appreciated.

Simon
0
Comment
Question by:Simon336697
[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
  • 4
5 Comments
 
LVL 35

Expert Comment

by:ShineOn
ID: 9816684
Your best tool for doing this will be WinBatch.

Go to www.wilsonwindowware.com.

You can use it in conjunction with a scheduling program.  There are many shareware schedulers out there.
0
 
LVL 35

Assisted Solution

by:ShineOn
ShineOn earned 125 total points
ID: 9816690
I, personally, did what you want to do using a combination of a scheduler, WinBatch, and PKZiP or some other ZIP-type utility.  The stuff to be archived automatically gets added to a ZIP (or whatever compressed archive format) file, using a filename generated based on date and/or sequence, all handled throught WinBatch and scheduled through a scheduling program, like Schedule Wizard.
0
 
LVL 35

Expert Comment

by:ShineOn
ID: 9816706
As far as the for statement you posted, I have no idea, not knowing what it is written in.  Is it DOS batch language or the updated Windows version of the DOS batch language, or some other batch language, or maybe even QuikBasic???  Dunno...

We  need more info on your environment and exactly how what data from where needs to be manipulated in what way to give you the result you're looking for...

Does that confuse you more or less?
0
 
LVL 18

Accepted Solution

by:
chicagoan earned 125 total points
ID: 9816751
i think the link s/b http://files.windowware.com/

0
 
LVL 35

Expert Comment

by:ShineOn
ID: 9817748
Thank you.  You are correct.  It used to be wilsonwindowware - they must've gotten a better URL in the past couple-few years... ;)
0

Featured Post

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

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

Suggested Solutions

Short answer to this question: there is no effective WiFi manager in iOS devices as seen in Windows WiFi or Macbook OSx WiFi management, but this article will try and provide some amicable solutions to better suite your needs.
If your business is like most, chances are you still need to maintain a fax infrastructure for your staff. It’s hard to believe that a communication technology that was thriving in the mid-80s could still be an essential part of your team’s modern I…
Internet Business Fax to Email Made Easy - With  eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, f…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

730 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