none
ROBOCOPY - Wildcard

    Question

  • I have backup files created hourly in the format 

    "SageAccts Company Name 2018-07-09 04-00-17" (Actual Company name is the same format, nothing crazy)

    I have been trying to only archive files from 10-12-14-16-18 pm and the rest can be deleted.

    For now ive just tried to move them but it is moving all of them: here is what i have tried:

    robocopy C:\SageBackups E:\test /mov 
    /XF "SageAccts Company Name ????-??-?? 10-??-??" 
    /XF "SageAccts Company Name ????-??-?? 12-??-??" 
    /XF "SageAccts Company Name ????-??-?? 14-??-??"
    /XF "SageAccts Company Name ????-??-?? 16-??-??"
    /XF "SageAccts Company Name ????-??-?? 18-??-??"

    Conrad Ryan

    Wednesday, July 11, 2018 7:35 AM

All replies

  • Hi,

    May I ask you want to exclude such files like  SageAccts Company Name 2018-07-09 04-00-17?

    Find there’s the  dashes (-))  in such name.

    Maybe you  could add  characters like below:

    robocopy /XF *-

    Best Regards,

    Mary


    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    Wednesday, July 11, 2018 9:33 AM
    Moderator
  • Hi,

    May I ask you want to exclude such files like  SageAccts Company Name 2018-07-09 04-00-17?

    Find there’s the  dashes (-))  in such name.

    Maybe you  could add  characters like below:

    robocopy /XF *-

    Best Regards,

    Mary


    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    Every file has dashes, i wish to only exclude files that are from certain times, the rest can be moved/deleted

    Conrad Ryan

    Wednesday, July 11, 2018 9:35 AM
  • Hi,

    You want to use robocopy exclude files that are from certain times, right?

    Based on my knowledge, robocopy supports a date for minage and maxage or a number of days. But it cannot filter on hours:minutes.

    Maybe you could also consult in Our Scripts forum, if other parameter could achieve this.

    In addition, please also check if the thread discussed in Scripts forum could be helpful.

    If it still shows no clue, you may consider to open a new thread in scripts forum.

    https://social.technet.microsoft.com/Forums/scriptcenter/en-US/b5cb685e-32f6-4eed-855d-e710ca4b203f/what-is-the-date-in-robocopys-minage-

    Best Regards,

    Mary


    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    Wednesday, July 11, 2018 9:51 AM
    Moderator
  • Hi,

    You want to use robocopy exclude files that are from certain times, right?

    Based on my knowledge, robocopy supports a date for minage and maxage or a number of days. But it cannot filter on hours:minutes.

    Maybe you could also consult in Our Scripts forum, if other parameter could achieve this.

    In addition, please also check if the thread discussed in Scripts forum could be helpful.

    If it still shows no clue, you may consider to open a new thread in scripts forum.

    https://social.technet.microsoft.com/Forums/scriptcenter/en-US/b5cb685e-32f6-4eed-855d-e710ca4b203f/what-is-the-date-in-robocopys-minage-

    Best Regards,

    Mary


    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    This is correct if you are utilizing the timestamps, however I am utilizing the file name which contains the time in text format, so it should be achievable

    Conrad Ryan

    Wednesday, July 11, 2018 10:28 AM
  • The best suggestion is to post in the scripting forum - https://social.technet.microsoft.com/Forums/scriptcenter/en-US/home?forum=ITCG.  You will find a lot more experts in scripting syntax in that forum.

    tim

    Wednesday, July 11, 2018 1:17 PM