• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Copy changed files only?

D

Daniel Erkan

#1
Hi!

I'd like to mirror a folder and its subfolders to another server
regularly, but in order to save time and bandwidth, it should only copy
files, that have actually changed.
I would use robocopy, but unfortunately it pretty much only produces
garbage under vista O_o

Any ideas?


Thanks,
Daniel
 

My Computer

G

George Davis

#2
This script should do it:

$changedFiles = dir | where { $_.Attributes -band
[System.IO.FileAttributes]::Archive }
foreach($file in $changedFiles)
{
$targetName = "z:\MySubDir\" + $file.Name
Copy-Item -path $file.FullName -Destination $targetName
}


"Daniel Erkan" wrote:

> Hi!
>
> I'd like to mirror a folder and its subfolders to another server
> regularly, but in order to save time and bandwidth, it should only copy
> files, that have actually changed.
> I would use robocopy, but unfortunately it pretty much only produces
> garbage under vista O_o
>
> Any ideas?
>
>
> Thanks,
> Daniel
>
 

My Computer

J

Jacques Barathon [MS]

#3
"Daniel Erkan" <sho@gmx.li> wrote in message
news:55largF25j5ekU1@mid.dfncis.de...
> Hi!
>
> I'd like to mirror a folder and its subfolders to another server
> regularly, but in order to save time and bandwidth, it should only copy
> files, that have actually changed.
> I would use robocopy, but unfortunately it pretty much only produces
> garbage under vista O_o


I am surprised that robocopy produces garbage under Vista. Are you using an
old version of robocopy on Vista? Have you tried the now built-in version?
If the built-in version doesn't work, what exactly is the "garbage" it
produces?

Jacques
 

My Computer

Users Who Are Viewing This Thread (Users: 1, Guests: 0)