Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4063704
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T15:45:38+00:00 2026-05-20T15:45:38+00:00

I am running a robocopy job through a batch file that is scheduled to

  • 0

I am running a robocopy job through a batch file that is scheduled to run every hour. I am using the following switches:

Robocopy \servername\share D:\somedir /E /R:5 /Log+:D:\Logs\CopyLog.txt

It has been working faithfully for a long time but it ran into a snag this morning. I went to check the log file and was suprised to find it had grown to just shy of 280 Mb.

My question then is how I can change my batchfile to write more managable log files? I think it would make sense to append on a period for which it is reported in. ie: CopyLog_201103.txt would be the log file for March 2011.

I’m fairly adept at working with higher level programming languages, but command line programming was already long gone by the time I was growing up. I’m definitely learning the value of getting a firm understanding of the much more basic computer concepts.

Any suggestions/advice would be appreciated, thanks in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T15:45:39+00:00Added an answer on May 20, 2026 at 3:45 pm

    You can get the day, month and year using this cmd snippet:

    for /f "usebackq tokens=1-3 delims=/" %%d in ('%date%') do (
        set day=%%d
        set month=%%e
        set year=%%f
    )
    

    (Warning: locale specific.)

    Now you can write to different log files as you see fit.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Running my script through Devel::NYTProf showed that the following portion of code took up
Running into the following error in MySQL. I have tried using convert as well
Running a rails site right now using SQLite3. About once every 500 requests or
Running Solr on Tomcat 7 on Win 2008 Server. I am looping through a
Running Puppet v2.7.14 on CEntOs 6 and also using Apache/Passenger instead of WEBrick. I
Running the following line in my script gives me a Permission denied error: $config_out
Running the following program on gcc (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3 and Intel(R) Core(TM)2 Duo CPU,
Running SQL Server 2008 (not R2). I have a few reports that have URLs
Running rails 3.2.3 with guard/spork/rspec/factory_girl and have the following in my spec helper: Spork.prefork
Running my finished Rails Tutorial app through Rails Best Practices got me a warning

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.