Help with Robocopy of files
Hi I have a Windows 2003 server where I have an application that logs daily files. The folder is C:\Logs, and each day, a folder with the date is created and, within this, a log file with the date too. For example: C:\Logs\20100812\Log_20100812.txt This process continues. So, after a week, I would have folders such as: C:\Logs\20100813 C:\Logs\20100814 C:\Logs\20100815 etc, each with their own log file within. I would like to copy each day's log file to another server and was going to use Robocopy via a scheduled task. Basically, each day, I would want to upload the previous day's log file. But I'm not sure how to upload the previous day's log file only, and leave the rest alone? Does anyone know what sort of switches I could use? From testing, this seems to work: robocopy \\server\c$\logs\\ \\server2\c$\copied\\ /maxage:2 /minage:1 /s I just want to be sure though :) The previous day's log file can be written to any time in yesterday's 24 hour period, depending on the app usage, so would maxage:2 and minage:1 cover all bases?
August 18th, 2010 6:46pm

Hi, Thanks for the post. Based on the following description for the File selection options, this command quite makes sense. /maxage:<N> Specifies the maximum file age (to exclude files older than N days or date). /minage:<N> Specifies the minimum file age (exclude files newer than N days or date). Thanks, MilesPlease remember to click Mark as Answer on the post that helps you, and to click Unmark as Answer if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
Free Windows Admin Tool Kit Click here and download it now
August 19th, 2010 12:38pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics