Windows Vista Forums
Vista Forums Home Join Vista Forums Donate Vista Tutorials Tags

Welcome to Vista Forums we are your forum to discuss Windows Vista x64 and x86 systems. Whether you need help or just want to post an idea you have on Vista, this is the forum for you.
Register at Vista forums...the world biggest Windows Vista resource Join Vista Forums Now

Go Back   Vista Forums > Microsoft Technical Newsgroups > PowerShell

Copy changed files only?

Update your Vista Drivers Update Your Drivers Now!!
Closed Thread
 
Thread Tools Display Modes
Old 03-12-2007   #1 (permalink)
Daniel Erkan
Guest


 

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
Guest


 

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]
Guest


 

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
Closed Thread

Thread Tools
Display Modes



Similar Threads
Thread Thread Starter Forum Replies Last Post
copy-item changing files attributes on network copy failures jas PowerShell 4 01-31-2008 12:39 PM
vista can't copy large files? another XP file-copy bug? Dave Vista General 3 01-26-2008 01:47 PM
changed the (open with) format now all my files are corrupted help changed the (open with) format Vista performance & maintenance 1 12-30-2007 06:55 AM
Recovery of Files from My Recently Changed Files Carol-Ann Vista General 3 10-01-2007 08:40 AM


Update your Vista Drivers Update Your Vista Drivers Now!!

Vistax64.com 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 2005-2008
Page generated in 0.24915 seconds with 10 queries