ROBOCOPY - Create Backup Script

Page 30 of 32 FirstFirst ... 202829303132 LastLast

  1. Posts : 26,869
    Windows 11 Pro
       #290

    Pyprohly said:
    essenbe said:
    I looks like you are trying to backup an entire drive. Robocopy backs up folders. After Z:/ you need a folder name which will be backed up.
    I’d like to know the basis of your claim because there’s certainly nothing wrong with robocopy z:\ u:\backup.
    The basis of my claim is I've tried it and never been able to make it work.
      My Computer


  2. Posts : 721
    Windows 10, Windows 8.1 Pro, Windows 7 Professional, OS X El Capitan
       #291

    Well try again because I guarantee it does work.


    See if this works for you.
    Code:
    rem Copy root files to “CDriveFiles” on desktop
    robocopy C:\ "%UserProfile%\Desktop\CDriveFiles" /w:0 /r:0 /a-:sh
      My Computer


  3. Posts : 10
    10 Pro
       #292

    Batch file example please


    It looks like robocopy is the way to go..

    I need a batch file, which copies a folder MM from the root 'C' drive to a USB pen ' Z' but appended with a time date...also prefer it not to,open a window but if possible give a confirmation message...

    Thanks
      My Computer


  4. Posts : 20
    Windows7 32bit
       #293

    Robocopy. Can backup script be appended


    I want to run a script as a bat file so it can be scheduled as a daily task. I think that ROBOCOPY is my best option but i cannot find suitable switches to make the script do what i want.

    I want to copy "eventfile.txt" from a source to destination folder.
    However, as this is a daily task, eventfile.txt will have a different text content (it is in fact my openvpn logfile) and after robocopy is run only the latest version of the file is copied to the destination, the previous day being overwritten.
    What I want it to do is append eventfile.txt to the destination file so I can build a history of all my vpn events. None of the switches appear to allow me to do that.
    Is there a workaround for this task?
      My Computer


  5. Posts : 721
    Windows 10, Windows 8.1 Pro, Windows 7 Professional, OS X El Capitan
       #294

    Trunxson, what about the /LOG+ switch? It acts like /LOG but will append instead of overwrite output.

    Code:
             /LOG:file : Output status to LOG file (overwrite existing log).
          /UNILOG:file : Output status to Unicode Log file (overwrite)
            /LOG+:file : Output status to LOG file (append to existing log).
         /UNILOG+:file : Output status to Unicode Log file (append)
      My Computer


  6. Posts : 20
    Windows7 32bit
       #295

    Thank you. I have used this switch, but the log file it writes to (and appends with LOG+) contains only data about the action of the robocopy command being carried out and not the actual file intended to be copied to a destination
      My Computer


  7. Posts : 721
    Windows 10, Windows 8.1 Pro, Windows 7 Professional, OS X El Capitan
       #296

    What data are you trying to append to eventfile.txt? Example?
      My Computer


  8. Posts : 20
    Windows7 32bit
       #297

    OpenVPN has a text format logfile in its >LOG subdirectory which overwrites each time openvpn connects. I am trying to capture this 'write' action by copying the logfile to another destination. Then i need to append each occurrence to a single file so i form a history.
    The Openvpn logfile has some 100-200 lines of text.

    For example


    Fri Dec 09 09:07:04 2016 OpenVPN 2.3_git x86_64-w64-mingw32 [SSL (OpenSSL)] [LZO] [LZ4] [PKCS11] [IPv6] built on Jul 26 2016
    Fri Dec 09 09:07:04 2016 Windows version 6.2 (Windows 8 or greater) 64bit
    Fri Dec 09 09:07:04 2016 library versions: OpenSSL 1.0.1t 3 May 2016, LZO 2.09
    Enter Management Password:
    Fri Dec 09 09:07:04 2016 MANAGEMENT: TCP Socket listening on [AF_INET]127.0.0.1:25340
    Fri Dec 09 09:07:04 2016 Need hold release from management interface, waiting...
    Fri Dec 09 09:07:04 2016 MANAGEMENT: Client connected from [AF_INET]127.0.0.1:25340
    Fri Dec 09 09:07:04 2016 MANAGEMENT: CMD 'state on'
    Fri Dec 09 09:07:04 2016 MANAGEMENT: CMD 'log all on'
    Fri Dec 09 09:07:04 2016 MANAGEMENT: CMD 'hold off'
    Fri Dec 09 09:07:04 2016 MANAGEMENT: CMD 'hold release'

    >>>>>>>>>>>>>>>
      My Computer


  9. Posts : 721
    Windows 10, Windows 8.1 Pro, Windows 7 Professional, OS X El Capitan
       #298

    I’m not sure what kind of an answer you’re expecting.

    You can Type the file then redirect the output to another file.

    Code:
    type file.txt >> elsewhere\file.txt
    This appends the content of “file.txt” to “elsewhere\file.txt”.
      My Computer


  10. Posts : 759
    Microsoft Windows 7 Ultimate 64-bit 7601 Multiprocessor Free Service Pack 1
       #299

    how to copy total drive folders including all available files ?


    Hi, I know and read the tutorials and tried myself a bit copying using robocopy which is a free larger size copy commands at cmd.
    i tried and copies so much files but now i am having issues with it.
    I want to copy a logical drive totally to a ext hard disk and i used this formula, which came with error .
    i miss something , would you please correct it
    robocopy d:\ g:\appacomputer /E/copyall/dcopy:T
    where my d:\ is a logical drive and g:\appacomputer is the destination folder (ext.hdd.disk).
    what is the mistake in the formula, it gives error such as destination not specified etc..
    Somewhere in some forum, i read it and made some slash changes, which immediately copied , but only the folders and sub folders without the files .
    Immediate response would be helpful as, i want to take a backup of the drive , as i am facing data loss. pl
    N.B: i want the date of folders and files of original date as at d: drive
      My Computer


 
Page 30 of 32 FirstFirst ... 202829303132 LastLast

  Related Discussions
Our Sites
Site Links
About Us
Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 11:34.
Find Us