I am running a robocopy process, and generating a log as follows:
robocopy "\\server1\reports" "c:\temp" /LOG+:"c:\scripts\logs\robolog-reports.txt"
The log file is created fine. Is there any way to limit the file size of the log file, ideally rolling the log so that only the newest XX lines or XX bytes are saved? I would like to do this all in one action (robocopy), and have the last several days of robocopy activity.
Thanks
The process of get the last N lines from a file is called tail. Try this:
There is no way to do this directly in one robocopy action.