robocopy files created yesterday

Discussion in 'Windows Server' started by Naruto, Jan 4, 2008.

  1. Naruto

    Naruto Guest

    Hi, I want to robocopy files created yesterday (based on the "Date Modified"

    It seems to me that the options
    are calculating based on 24 hrs timeframe.
    For example, if I use /MAXAGE:1 and robocopy at 3pm, I will get the logs
    from 3pm yesterday up to current time but not the logs at 2:59 pm yesterday.

    Please advise.
    Thanks in advance.
    Naruto, Jan 4, 2008
    1. Advertisements

  2. Naruto

    Naruto Guest

    Of course I could schedule a job to run at every 12:00AM as a workaround.
    But this is not I want to achieve as some source servers may be busy at that
    Naruto, Jan 4, 2008
    1. Advertisements

  3. Instead of specifying /MaxAge:n, specify /MaxAge:YYYYMMDD.
    Pegasus \(MVP\), Jan 4, 2008
  4. Naruto

    Shoma Gujjar Guest

    u can try the below code to get the current date in yyyymmdd format and use it with robocopy along with minage:

    string current_date=DateTime.Now.ToString("yyyyMMdd");

    proc.StartInfo.Arguments=""+ tempsrc + " "+ tempdst+" "+"/minage:"[email protected]_date+"";
    //+" "+"/mov";
    Shoma Gujjar, Oct 24, 2008
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.