-2

I have a requirement for a batch script. I have log file under below directory (actually multiple directories with different names under E:\TIBCO\).

E:\TIBCO\*\6.0.0\LogFiles with Spotfire.Dxp.Automation.*.*

I need to perform below steps with the batch script

  1. move (copy and delete) all the files that are with Spotfire.Dxp.*.*.* (ex Spotfire.Dxp..1.) from the above paths to E:\TIBCO\logsArchival\rotatedDir

  2. zip all the files that are older than 60 from E:\TIBCO\logsArchival\rotatedDir to E:\TIBCO\logsArchival\ArchiveDir

  3. delete the zip files that are older than 120 days from E:\TIBCO\logsArchival\ArchiveDir

All the above steps need to be written to the logs.

halfer
  • 19,824
  • 17
  • 99
  • 186
user1658369
  • 99
  • 1
  • 11
  • 1
    What is your problem with this batch script? What have you tried and where do you get stuck? – VMai May 13 '14 at 16:06

1 Answers1

0

Please take a look at these links, where your requirement has been addressed before: MS Dos Batch delete old files in directory and Batch file to delete files older than N days
You can easily customize those scripts to accomplish the remaining compression of the files. Please note, that in DOS the compress command is COMPACT. Use COMPACT /H for usage information.

Community
  • 1
  • 1
hsiegeln
  • 116
  • 4