Solved

Incremental bat backup script.

Posted on 2009-07-07
13
904 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
How our DevOps Teams Maximize Uptime

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us. Read the use case whitepaper.

 

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

How Do You Stack Up Against Your Peers?

With today’s modern enterprise so dependent on digital infrastructures, the impact of major incidents has increased dramatically. Grab the report now to gain insight into how your organization ranks against your peers and learn best-in-class strategies to resolve incidents.

Question has a verified solution.

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

I have published numerous articles here at Experts Exchange that present programs/scripts written in a language called AutoHotkey. Each of those articles has a brief paragraph describing where to download the product and how to install it. I have al…
Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

829 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