Automate archiving and deletion of reports

  • Thread starter Thread starter Raj
  • Start date Start date
R

Raj

Hi,
We Have a batch file which generates a report in Ms Excel everyday. We
would like to save 4 prior versions of the reports in a separate
archive directory. As new reports are run each day and posted to the
directory above, the prior day's report should automatically be moved
to the Archive directory, and the reports from 5 days ago can be
deleted.
Can this be achieved by writing a batch file.

Also since the name of the report keeps changing everyday like
report_021306 for today
report_021206 yesterday. How to automate this procedure where in it
automatically archives the report if its 1 day old to archive directory
and deletes it if its 5 days old.

Please help me
Thanks in advance
Rajesh
 
Raj said:
Hi,
We Have a batch file which generates a report in Ms Excel everyday. We
would like to save 4 prior versions of the reports in a separate
archive directory. As new reports are run each day and posted to the
directory above, the prior day's report should automatically be moved
to the Archive directory, and the reports from 5 days ago can be
deleted.
Can this be achieved by writing a batch file.

Also since the name of the report keeps changing everyday like
report_021306 for today
report_021206 yesterday. How to automate this procedure where in it
automatically archives the report if its 1 day old to archive directory
and deletes it if its 5 days old.

Please help me
Thanks in advance
Rajesh

To delete reports older than 5 days::

xxcopy /db#5 /rs /yy "c:\Reports\*.*" c:\temp\

To move reports older than 1 day:

xxcopy /db#1 /rc /yy "c:\Report\*.*" c:\Archive'

xxcopy.exe can be downloaded from a number of sites.
robocopy.exe from the Windows Resource Kit has
similar options.
 
Thanks a lot for your input
Can I use xxcopy on the server for my company and its not for my
personal use . Is it freeware like sysinternals tools.

also I was looking at robocopy it has options like Last
modified/accessed date but not created date. So the logic will fail
becuase the reports will be accessed 24/7.

Thanks again
Raj
 
If you're unsure about copyright issues then you should
get in touch with the author of xxcopy.exe.
 
I was able to do with robocopy which is part of Windows resource kit.
Thanks a lot for your input, you are simply awesome!!!!!
Raj
 
Back
Top