Batch File that compares files from source to destination before copy

View: New views
4 Messages — Rating Filter:   Alert me  

Batch File that compares files from source to destination before copy

by Tabanan, R. :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi guys,

I am in need of a batch filen that will compare whatever is on a source
directory and copy only those.  Any extra files that is seen on the
destination will be purged.  

I currently use xcopy to copy files from destination.  But if anything
changes on the source let us say one file has been deleted, I have no
way of deleting it on the destination than doing it manually.  Ideally
I would like to load this as a logon script.

Thanks,


Re: Batch File that compares files from source to destination before copy

by foxidrive-7 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Sun, 16 Nov 2008 04:20:41 -0000, "Tabanan, R." <yoyong222@...>
wrote:

>Hi guys,
>
>I am in need of a batch filen that will compare whatever is on a source
>directory and copy only those.  Any extra files that is seen on the
>destination will be purged.  
>
>I currently use xcopy to copy files from destination.  But if anything
>changes on the source let us say one file has been deleted, I have no
>way of deleting it on the destination than doing it manually.  Ideally
>I would like to load this as a logon script.
>
>Thanks,

Use robocopy or XXcopy


Re: Batch File that compares files from source to destination before copy

by Tabanan, R. :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,
 
I am currently using robocopy with the /s /y switch.  But is it capable of deleting the files on the destination by comparing if the file still exist on the source?
 
Thanks,

--- On Sun, 11/16/08, foxidrive <foxidrive@...> wrote:

From: foxidrive <foxidrive@...>
Subject: Re: [BATCH WORLD] Batch File that compares files from source to destination before copy
To: batchworld@...
Date: Sunday, November 16, 2008, 12:09 AM






On Sun, 16 Nov 2008 04:20:41 -0000, "Tabanan, R." <yoyong222@yahoo. com>
wrote:

>Hi guys,
>
>I am in need of a batch filen that will compare whatever is on a source
>directory and copy only those. Any extra files that is seen on the
>destination will be purged.
>
>I currently use xcopy to copy files from destination. But if anything
>changes on the source let us say one file has been deleted, I have no
>way of deleting it on the destination than doing it manually. Ideally
>I would like to load this as a logon script.
>
>Thanks,

Use robocopy or XXcopy

 














     

[Non-text portions of this message have been removed]


Re: Batch File that compares files from source to destination before copy

by foxidrive-7 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


This is what I use to mirror a folder to another folder.



@echo off
if %2.==. goto :EOF
robocopy %1 %2 /FFT /R:0 /MIR /NP /TEE /LOG:"%temp%.\robocopy.log"
if errorlevel 1 echo Errors Detected&pause


Read what the switches do in the documentation and decide if they are right
for your application.  Be careful with the switches and test it on a copy
of your data to ensure that it works as you think it will.



On Sun, 16 Nov 2008 07:51:18 -0800 (PST), Yoyong <yoyong222@...>
wrote:

>I am currently using robocopy with the /s /y switch.  But is it capable of deleting the files on the destination by comparing if the file still exist on the source?

>Thanks,
>
>--- On Sun, 11/16/08, foxidrive <foxidrive@...> wrote:
>
>From: foxidrive <foxidrive@...>
>Subject: Re: [BATCH WORLD] Batch File that compares files from source to destination before copy
>To: batchworld@...
>Date: Sunday, November 16, 2008, 12:09 AM
>
>
>
>
>
>
>On Sun, 16 Nov 2008 04:20:41 -0000, "Tabanan, R." <yoyong222@yahoo. com>
>wrote:
>
>>Hi guys,
>>
>>I am in need of a batch filen that will compare whatever is on a source
>>directory and copy only those. Any extra files that is seen on the
>>destination will be purged.
>>
>>I currently use xcopy to copy files from destination. But if anything
>>changes on the source let us say one file has been deleted, I have no
>>way of deleting it on the destination than doing it manually. Ideally
>>I would like to load this as a logon script.
>>
>>Thanks,
>
>Use robocopy or XXcopy
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>      
>
>[Non-text portions of this message have been removed]
>
>
>------------------------------------
>
>To Post a message, send it to:   batchworld@...
>
>To Unsubscribe, send a blank message to: batchworld-unsubscribe@...! Groups Links
>
>
>