Robocopy question

Discussion in 'other software & services' started by n8chavez, Jul 4, 2010.

Thread Status:
Not open for further replies.
  1. n8chavez

    n8chavez Registered Member

    Joined:
    Jul 19, 2003
    Posts:
    3,355
    Location:
    Location Unknown
    Is there a way I can use Robocopy to copy everything (with for qualificatyions) from my system to an external using a bat file? These data transfers would essentially be incremental, as data constantly changes. I would need the data inly to get transfered over only if it does not exist on the destination and if the file sizes are different between the source and destination. I can do that now with Syncback but the inner geek in me prefers command line tools, and I've been having some issue with Syncback and BSOds.

    I plan on using multiple .bat files; one for each source/destination pairing.
     
  2. Brian K

    Brian K Imaging Specialist

    Joined:
    Jan 28, 2005
    Posts:
    12,178
    Location:
    NSW, Australia
    Nate,

    Yes, you can do that from a batch file. You can create and maintain a mirrored copy. But files in use can't be copied so it's not much use for the OS partition.

    Robocopy GUI will generate command lines for you.
     
  3. n8chavez

    n8chavez Registered Member

    Joined:
    Jul 19, 2003
    Posts:
    3,355
    Location:
    Location Unknown

    I've been slowly but surely backing up all my movies and TV DVDs into xvid, which can play on my mp3 player, that way should anything happen to them I'll still have the copies. I'm not planning on backing up anything on my system partition, just files that will not be locked.

    That being said, I have no clue on how to go about this. I've looked at both the gui and the "better gui" ande have no idea where to start, like how to compare the timestamps ands see what needs transferring.

    Any help woulds be great.
     
  4. n8chavez

    n8chavez Registered Member

    Joined:
    Jul 19, 2003
    Posts:
    3,355
    Location:
    Location Unknown
    From what I can tell, it seems those time stamps are checked by default. That's very cool. I'm attempting to backup everything using the below bat. I'll let you know how things go. But, so far I'm very impressed.

    But I do have a few questions, like hoiw to direct a log file to a different location. It would be, ideally, /TEE /UNICODE /LOG:z:\Logs\Documents -%DD%%MM%%YY% but that won't work.
     
    Last edited: Jul 5, 2010
  5. n8chavez

    n8chavez Registered Member

    Joined:
    Jul 19, 2003
    Posts:
    3,355
    Location:
    Location Unknown
    Can anyoe tell me why this doesn't work. I keep getting an error about the log not being a valid path.

    Robocopy D:\Documents h:\Mine\Documents *.* /ZB /COPYALL /R:10 /LOG:z:\Logs\Documents - %DD%%MM%%YY%.log /TEE /UNICODE
     
  6. pandlouk

    pandlouk Registered Member

    Joined:
    Jul 15, 2007
    Posts:
    2,976
    Hi Nate,

    why don't you use RichCopy instead of batch files?

    Panagiotis
     
  7. Cudni

    Cudni Global Moderator

    Joined:
    May 24, 2009
    Posts:
    6,963
    Location:
    Somethingshire
    as a guess and assuming Z: drive exists what if you use z:\Logs\%DD%%MM%%YY%.log or z:\Logs\Documents\%DD%%MM%%YY%.log instead?
     
  8. n8chavez

    n8chavez Registered Member

    Joined:
    Jul 19, 2003
    Posts:
    3,355
    Location:
    Location Unknown
    I guess the answer there is that I'm a dork. Truly. I prefer command line applications. And also, I figure the less third party applications I run the less chance of getting a BSOD, which I had a problem with using SyncBack.
     
  9. n8chavez

    n8chavez Registered Member

    Joined:
    Jul 19, 2003
    Posts:
    3,355
    Location:
    Location Unknown
    The off thing is that it tell me that the /LOG: parameter is invalid. So, I don't think it has anything to do with the file name.

    sshot-1.png
     
  10. philby

    philby Registered Member

    Joined:
    Jan 10, 2008
    Posts:
    944
    Robocopy D:\Documents h:\Mine\Documents *.* /ZB /COPYALL /R:10 /LOG:z:\Logs\Documents - %DD%%MM%%YY%.log /TEE /UNICODE

    My robocopy bat files work with .txt extensions rather than .log - is that what's wrong here?

    If not, then please excuse batch-file-ignorance-from-command-line-noob.

    Just trying to help...

    philby
     
  11. pandlouk

    pandlouk Registered Member

    Joined:
    Jul 15, 2007
    Posts:
    2,976
    Instead of
    Robocopy D:\Documents h:\Mine\Documents *.* /ZB /COPYALL /R:10 /LOG:z:\Logs\Documents - %DD%%MM%%YY%.log /TEE /UNICODE

    use

    Robocopy D:\Documents h:\Mine\Documents *.* /ZB /COPYALL /R:10 /LOG: z:\Logs\Documents - %DD%%MM%%YY%.log /TEE /UNICODE

    you missed to leave a space after /Log:

    Panagiotis
     
  12. n8chavez

    n8chavez Registered Member

    Joined:
    Jul 19, 2003
    Posts:
    3,355
    Location:
    Location Unknown
    hmmm....I get the same message.
     
  13. pandlouk

    pandlouk Registered Member

    Joined:
    Jul 15, 2007
    Posts:
    2,976
    Try this

    Robocopy D:\Documents h:\Mine\Documents *.* /ZB /COPYALL /R:10 /LOG: "z:\Logs\Documents - %DD%%MM%%YY%.log" /TEE /UNICODE

    or maybe
    Robocopy D:\Documents h:\Mine\Documents *.* /ZB /COPYALL /R:10 /LOG "z:\Logs\Documents - %DD%%MM%%YY%.log" /TEE /UNICODE
     
  14. n8chavez

    n8chavez Registered Member

    Joined:
    Jul 19, 2003
    Posts:
    3,355
    Location:
    Location Unknown
    Thank you for your help. I appreciate it. Unfortunately, I didn't work; I still gt the same error. And don't worry, if I was any kind of expert I wouldn't be asking.

    :)
     
  15. pandlouk

    pandlouk Registered Member

    Joined:
    Jul 15, 2007
    Posts:
    2,976
    I checked the robocopy help
    the correct one is
    Robocopy D:\Documents h:\Mine\Documents *.* /ZB /COPYALL /R:10 /LOG:"z:\Logs\Documents - %DD%%MM%%YY%.log" /TEE /UNICODE
     
  16. n8chavez

    n8chavez Registered Member

    Joined:
    Jul 19, 2003
    Posts:
    3,355
    Location:
    Location Unknown
    Thanks a bunch dude. That didn't work, but using the same line and just deleting the extra space did.

    /LOG:"z:\Logs\Documents - %DD%%MM%%YY%.log"

    Except, "%MM%%DD%%YY%" did not work; nothing is there at all.
     
  17. n8chavez

    n8chavez Registered Member

    Joined:
    Jul 19, 2003
    Posts:
    3,355
    Location:
    Location Unknown
    I think I've gotten everything to work perfectly. My master sync bat, because I have individual ones with the log switches, is:

    Thanks for your help everyone. I hope someone can find this useful
     
    Last edited: Jul 5, 2010
  18. The Seeker

    The Seeker Registered Member

    Joined:
    Oct 24, 2005
    Posts:
    1,339
    Location:
    Adelaide
    Gotta love Robocopy. Here's my daily backup parameters:

    Code:
    robocopy C:\Users\Gavin K:\External_Backup /MIR /XA:H /XD AppData /XJD
     
  19. n8chavez

    n8chavez Registered Member

    Joined:
    Jul 19, 2003
    Posts:
    3,355
    Location:
    Location Unknown
    Agreed. Everyone should ditch their third party solutions and try this. Yes, you'll have to spend a little time research the correct switches. But it's worth it.
     
Thread Status:
Not open for further replies.
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.