Windows 7 Forums

Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.


Windows 7: ROBOCOPY - Create Backup Script

14 Oct 2016   #290
essenbe

Windows 7 Enterprise X64/Windows 10 Enterprise X64/Windows 10 Pro X64/Linux Mint
 
 

Quote   Quote: Originally Posted by Pyprohly View Post
Quote   Quote: Originally Posted by essenbe View Post
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 System SpecsSystem Spec
.
15 Oct 2016   #291
Pyprohly

Windows 10, Windows 8.1 Pro, Windows 7 Professional, OS X El Capitan
 
 

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 System SpecsSystem Spec
22 Oct 2016   #292
reddwarf4ever

10 Home upgradd from 7
 
 
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 System SpecsSystem Spec
08 Dec 2016   #293
trunxson

Windows7 32bit
 
 
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 System SpecsSystem Spec
.

09 Dec 2016   #294
Pyprohly

Windows 10, Windows 8.1 Pro, Windows 7 Professional, OS X El Capitan
 
 

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 System SpecsSystem Spec
09 Dec 2016   #295
trunxson

Windows7 32bit
 
 

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 System SpecsSystem Spec
09 Dec 2016   #296
Pyprohly

Windows 10, Windows 8.1 Pro, Windows 7 Professional, OS X El Capitan
 
 

What data are you trying to append to eventfile.txt? Example?
My System SpecsSystem Spec
10 Dec 2016   #297
trunxson

Windows7 32bit
 
 

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 System SpecsSystem Spec
10 Dec 2016   #298
Pyprohly

Windows 10, Windows 8.1 Pro, Windows 7 Professional, OS X El Capitan
 
 

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 System SpecsSystem Spec
Reply

 ROBOCOPY - Create Backup Script




Thread Tools




Similar help and support threads
Thread Forum
robocopy script is not working through Scheduler
Dear All, My batch file of robocopy is working fine. But when I tried to run it through task scheduler, none of the files transfer to the target location. @echo off echo +-----------------------------------------+ echo Database Export Utility for server ...
General Discussion
Robocopy Backup - ERROR 5 (0x00000005)
Hi, I'm wondering if anyone might be able to shed some light on why I am getting the following such errors when running a robocopy batch file (as administrator) which cause the backup script to stall (- albeit temporarily): I am using the following backup command: robocopy "%srcPath%\My...
Backup and Restore
How 2 create a script/BAT or something that changes my desktop image?
Okay so I just got this program called Transparent Screen Lock and you can run files when the program starts/locks and closes/unlocks. What I would like to do is create a script or something that changes my desktop background to an image when I click "lock" and another script to change the desktop...
Customization
Robocopy backup for personal folders
I have created a batch file for copying my Documents folder to an external hard drive: The log file shows that it is backing up C:\users\USERNAME\documents\My Music and C:\users\USERNAME\documents\My Pictures. That's fine, because I want those backed up anyway, but when I go to...
Backup and Restore
I Need Help To Create REG. Script With Admin. Priv. For Reg. Editor?
Hello. I have a technical question/issue I wish to ask. I hope someone can help me. I am looking help for someone to modify or rewrite for me a simple system registry script for my context menu that allows or forces to "run as administrator" privileges automatically when I click on the...
Customization
Anyone use robocopy to backup?
Evening all, Just curious to know if anyone uses the built in utility to backup software on your machine, im trying to backup my itunes folder to an external HD but having a few issues to get this to work properly! I also use sync toy for backing up but just really want to know what everyone...
Backup and Restore


Our Sites

Site Links

About Us

Find 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 01:28.
Twitter Facebook Google+ Seven Forums iOS App Seven Forums Android App



Windows 7 Forums