- synchronisation via batch commands
- Posted by anthony@accessgroup.co.uk on November 23rd, 2006
I have a batch file backup in place in the office which copies all
files from a shared directory to a separate PC - providing date stamp
is newer etc. However, if a user deletes a file from the source
directory a copy will still exist in the destination directory. Is
there a batch command I can run, say once a week, that will compare the
directory structures and delete any redundant files from the
destination directory. Examples would be really helpful.
Many thanks,
Anthony
- Posted by John John on November 23rd, 2006
You could do that with Robocopy.exe
http://support.microsoft.com/kb/160513/
http://www.ss64.com/nt/robocopy.html
Or with xxcopy: http://www.xxcopy.com/index.htm
John
anthony@accessgroup.co.uk wrote:
- Posted by Bruce on November 24th, 2006
anthony@accessgroup.co.uk wrote:
REM first change to your destination directory. ie if this is d:\dest
d:
cd \dest
REM replace s:\source by your source directory
for %f in (*.*) do if not exist s:\source\%f del %f
- Posted by anthony@accessgroup.co.uk on November 24th, 2006
Thanks for your prompt help John. Have read the tech spec and it looks
perfect for what I need - the /purge switch is just what I was looking
for.
Thanks again,
Anthony 
John John wrote:
- Posted by John John on November 24th, 2006
You're welcome.
John
anthony@accessgroup.co.uk wrote: