Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
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
Medium Priority
?
248 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 375 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 375 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

Fill in the form and get your FREE NFR key NOW!

Veeam® is happy to provide a FREE NFR server license to certified engineers, trainers, and bloggers.  It allows for the non‑production use of Veeam Agent for Microsoft Windows. This license is valid for five workstations and two servers.

Question has a verified solution.

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

Make the most of your online learning experience.
This month, Experts Exchange’s free Course of the Month is focused on CompTIA IT Fundamentals.
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…

610 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