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"
    timestamp)

    It seems to me that the options
    /MAXLAD
    /MINLAD
    /MAXAGE
    /MINAGE
    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
    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
    time
     
    Naruto, Jan 4, 2008
    #2
    1. Advertisements

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

    Shoma Gujjar Guest

    hi...
    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.FileName="C:\\robocopy.exe";
    proc.StartInfo.Arguments=""+ tempsrc + " "+ tempdst+" "+"/minage:"[email protected]_date+"";
    //+" "+"/mov";
    proc.StartInfo.UseShellExecute=false;
    proc.Start();
    proc.Close();
     
    Shoma Gujjar, Oct 24, 2008
    #4
    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.