Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > PowerShell

Vista - Copy changed files only?

Reply
 
Old 03-12-2007   #1 (permalink)
Daniel Erkan


 
 

Copy changed files only?

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 System SpecsSystem Spec
Old 03-12-2007   #2 (permalink)
George Davis


 
 

RE: Copy changed files only?

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 System SpecsSystem Spec
Old 03-15-2007   #3 (permalink)
Jacques Barathon [MS]


 
 

Re: Copy changed files only?

"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 System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
Recovery of Files from My Recently Changed Files Vista General
how to copy file every time it has changed? VB Script
copy-item changing files attributes on network copy failures PowerShell
vista can't copy large files? another XP file-copy bug? Vista General


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46