also @ TechSpot: Call of Duty: Modern Warfare 2 Graphics Card Performance
Welcome to the TechSpot OpenBoards. Please read the FAQ if you have any questions. Login to participate.

Go Back   TechSpot OpenBoards > Operating Systems & Software > Software & Utilities in General

Batch file to synchronize folders over a network

Closed Thread
Bookmark Thread Tools
  #1  
Old 05-17-2005
poertner_1274's Avatar
TS Special Forces
 
Location: Saint Louis, MO, USA
Member since: Feb 2002, 4,646 posts
System specs
Batch file to synchronize folders over a network

Right now I've got a batch file to backup from My Documents to a networked drive at work. But I was wondering if there was a way to do this, but check to see if a file has been deleted. I have gotten rid of some files in my documents and they are still on my network drive. If I don't delete them from both at the same time I forget which ones they are.
Anyway, I know this is possible with a 3rd party software, but I wanted to get it done throught his batch file if at all possible, since it is a work computer and I'm not supposed to install anything onto it

This is what I am currently using.

@echo off
:: variables
set drive=j:\
set backupcmd=xcopy /s /c /d /e /h /i /r /k /y

echo ### Backing up My Documents...
%backupcmd% "%USERPROFILE%\My Documents" "%drive%"

:: use below syntax to backup other directories...
:: %backupcmd% "...source directory..." "%drive%\...destination dir..."

echo Backup Complete!
@pause
  #2  
Old 05-17-2005
TechSpot Evangelist
 
Location: has left the building
Member since: Aug 2003, 8,160 posts
You would not need that at all, if you would set the J-drive's %USERPROFILE%\My Documents as your default in your PC.
(unless your network is slooooowww, or not always available).

Check if your company has Ontrack's (or V-Com's now) Powerdesk (Explorer replacement) available, that has built-in folder synchronisation. Laplink can do the same.

Your current batchfile cannot do that, there are simply no switches for that in xcopy.
To remove this ad, sign in. To register for a new account, click here.
  
  #3  
Old 05-20-2005
Newcomer, in training
 
Member since: Jan 2005, 47 posts
hi,
i dont think xcopy supports network, though:
1. (if you can) program in VB then you can use the built in functons and make a full standalone app or even an invisible app....
2. (alternative) make it copy to a big data stick/hdd with all the backup stuff on it
3. you could setup mirroring im not entirly sure who or where youcan get the service it just exists....

j4m32,
  #4  
Old 05-20-2005
andygibbs's Avatar
TechSpot Member
 
Location: UK
Member since: Feb 2005, 76 posts
Maybe a program like this would do what you want:

http://sourceforge.net/projects/dirssync


Edit: sorry just realised you said you didn't want to use an app
  #5  
Old 05-20-2005
poertner_1274's Avatar
TS Special Forces
 
Location: Saint Louis, MO, USA
Member since: Feb 2002, 4,646 posts
System specs
Thanks for the suggestions, I don't think an open source program would be a problem. I'll give that a look, but I think I have figured out how I will do it. It's not efficient, but it works.
  #6  
Old 05-20-2005
Liquidlen's Avatar
TechSpot Paladin
 
Location: Canada
Member since: Oct 2003, 1,646 posts
Poertner;
My Batch work is rusty ,but I do have a command line /Scipt manual .So I will look this up if you want me to.
In the meantime,If these files(the ones you want to delete) always have the same name or can sit in the same Directory( Therefore you can state them as a variable) You can parse for their existence, then Goto your Xcopy command
eg.
for iterator (initialization variable and a set of files to execute against) do (Command)
If I understand your needs correctly this should work.
  #7  
Old 05-22-2005
patio's Avatar
TechSpot Booster
 
Member since: Nov 2004, 689 posts
SyncBack...

patio.
Closed Thread

Tip: Download Advanced SystemCare 3 Freeware - 1 Click A Day to Clean, Repair, Protect & Optimize your PC.

Thread Tools


Similar Topics
Topic Category Replies Last Post
freaky chkdsk.. Windows OS 90 03-16-2007 08:24 PM
Mysterious CD burning problem General Hardware 3 05-17-2006 04:50 PM
DVD burner wont burn General Hardware 2 03-12-2005 08:04 PM
Make a batch file open a program in XP Windows OS 4 12-02-2004 09:23 AM
Asus CD burner cannor burn!! Storage & Networking 7 06-11-2004 05:54 AM


All times are GMT -4. The time now is 12:48 AM.