Solved

Incremental bat backup script.

Posted on 2009-07-07
13
895 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
  • 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
 

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
Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

 

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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

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…
YESTERDAY YESTERDAY.BAT is inspired by a previous article I wrote entitled: TOMORROW.BAT (http://www.experts-exchange.com/OS/Microsoft_Operating_Systems/MS_DOS/A_4196-Advanced-Batch-File-Programming-TOMORROW-BAT.html). The crux of this batch f…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

762 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now