Solved

Incremental bat backup script.

Posted on 2009-07-07
13
907 Views
Last Modified: 2012-06-21
Hi EE.

i need a little help for a simple script.

Wants to some folders to be incremental backup

From C:\App -> E:\App
From C:\List -> E:\App.

I have worked a bit with my own script, but cant get it to work 100 %.

If i delete a file in C:\App the file also should be deleted in E:\App

Thank you
0
Comment
Question by:JarlK
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 5
  • 3
13 Comments
 
LVL 9

Accepted Solution

by:
DCMBS earned 250 total points
ID: 24792788
I would use the following delta copy utilty for this.  when set up correctly it will synchronise the destination and source folders automatically and is very efficient at copying the files.

http://www.aboutmyip.com/AboutMyXApp/DeltaCopy.jsp
0
 
LVL 19

Assisted Solution

by:deroode
deroode earned 50 total points
ID: 24792868
Normally, you would use a tool like robocopy  to perform such a synchronization.

Robocopy.exe c:\app e:\app /mir

The culprit however is that you are trying to synchronize from two directories to one. Robocopy will mirror the entire directory, thus with the above command deleting everything that originally came from C:\list

A solution could be devised if the filenames in C:\app and c:\list are sufficiently different that the filenames that are found in c:\list can be excluded in the robocopy command from c:\app, and vice versa.

for instance:

robocopy c:\app e:\app /mir /XF *.lst
robocopy c:\list e:\app /mir /XF *.exe


robocopy can be found here:
http://www.microsoft.com/downloads/details.aspx?FamilyID=9D467A69-57FF-4AE7-96EE-B18C4790CFFD&displaylang=en
0
 
LVL 9

Expert Comment

by:DCMBS
ID: 24792910
Robocopy is a good tool and works similarly to deltacopy. The main difference is that robocopy copies the entire file every time it detects a change whereas deltacopy will only copy changes to the file.  If you have large files in which only a small parts are changed then deltacopy can be very efficient.
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:JarlK
ID: 24793014
I like deltatool.

I can get it to work on my machine, but not on my costumers ?




Connection is sucessful when i try to test the connection!
Executing: rsync.exe  -v -rlt -z --delete "/cygdrive/C/util/" "HP11103174822::Villadsenssmedie	/util/"
@ERROR: Unknown module 'Villadsenssmedie	'
 
rsync error: error starting client-server protocol (code 5) at /home/lapo/packaging/rsync-3.0.4-1/src/rsync-3.0.4/main.c(1504) [sender=3.0.4]
 
Error starting client-server protocol
Rsync.exe returned an error. Will try again. This is retry number 1 of 5
 
Executing: rsync.exe  -v -rlt -z --delete "/cygdrive/C/util/" "HP11103174822::Villadsenssmedie	/util/"
@ERROR: Unknown module 'Villadsenssmedie	'
rsync error: error starting client-server protocol (code 5) at /home/lapo/packaging/rsync-3.0.4-1/src/rsync-3.0.4/main.c(1504) [sender=3.0.4]
 
Error starting client-server protocol
Rsync.exe returned an error. Will try again. This is retry number 2 of 5
 
Executing: rsync.exe  -v -rlt -z --delete "/cygdrive/C/util/" "HP11103174822::Villadsenssmedie	/util/"
@ERROR: Unknown module 'Villadsenssmedie	'
rsync error: error starting client-server protocol (code 5) at /home/lapo/packaging/rsync-3.0.4-1/src/rsync-3.0.4/main.c(1504) [sender=3.0.4]
 
Error starting client-server protocol
Rsync.exe returned an error. Will try again. This is retry number 3 of 5
 
Executing: rsync.exe  -v -rlt -z --delete "/cygdrive/C/util/" "HP11103174822::Villadsenssmedie	/util/"
@ERROR: Unknown module 'Villadsenssmedie	'
rsync error: error starting client-server protocol (code 5) at /home/lapo/packaging/rsync-3.0.4-1/src/rsync-3.0.4/main.c(1504) [sender=3.0.4]
 
Error starting client-server protocol
Rsync.exe returned an error. Will try again. This is retry number 4 of 5
 
Executing: rsync.exe  -v -rlt -z --delete "/cygdrive/C/util/" "HP11103174822::Villadsenssmedie	/util/"
@ERROR: Unknown module 'Villadsenssmedie	'
rsync error: error starting client-server protocol (code 5) at /home/lapo/packaging/rsync-3.0.4-1/src/rsync-3.0.4/main.c(1504) [sender=3.0.4]
 
Error starting client-server protocol
Profile 'test' executed in 344 milliseconds. One or more errors were encountered.

Open in new window

0
 
LVL 9

Expert Comment

by:DCMBS
ID: 24793072
HP11103174822::Villadsenssmedie      /util/

This doesn't right if you are copying to a remote machine.

See the following link for how to specify the connection.

http://everythinglinux.org/rsync/
0
 
LVL 19

Expert Comment

by:deroode
ID: 24793076
HP11103174822 can be found without full domain name?

Villadsenssmedie is configured as a virtual directory on the receiving server?
0
 

Author Comment

by:JarlK
ID: 24793123
Its just a single computer.

The network name of the computer is : HP11103174822

So i have installed the server and client on same machine!
0
 
LVL 9

Expert Comment

by:DCMBS
ID: 24793137
I can get it to work on my machine, but not on my costumers ?

Apologies, I don't quite understand.

what is the difference between a set up that works on your machine, and the setup that doesn't work
0
 

Author Comment

by:JarlK
ID: 24793143
DCMBS : I just tried to make a test on my own pc, where i had no problems at all.
0
 
LVL 9

Expert Comment

by:DCMBS
ID: 24793159
So we need to pin down the difference between machines ?
0
 

Author Comment

by:JarlK
ID: 24793182
I have found the error!

:) I have made a space in the name of the "server" That is not allowed! Thank you!


Very nice app.
0
 
LVL 19

Expert Comment

by:deroode
ID: 24793203
Very nice app indeed.

And does it handle the two sources - one destination conflict without removing files?
0
 

Author Comment

by:JarlK
ID: 24793277
Yes !

Very nice!
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This script will sweep a range of IP addresses (class c only, 255.255.255.0) and report to a log the version of office installed. What it does: 1.)      Creates log file in the directory the script is run from (if it doesn't already exist) 2.)      Sweep…
With User Account Control (UAC) enabled in Windows 7, one needs to open an elevated Command Prompt in order to run scripts under administrative privileges. Although the elevated Command Prompt accomplishes the task, the question How to run as script…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

733 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question