Giter Site home page Giter Site logo

qopy's Introduction

Qopy

A Quick Powershell File Copy Module with CRC Check.

XCopy, Robocopy and Teracopy are all good Windows utilities for copying a large amount of files, but none of them offer easily machine-readable results report. An efficient, reliable and audit-able copy utility is critical for large-scale, automated software deployments.

Qopy is a binary Powershell Module that provides some the functionality of all of those other utilities with an object output for advanced reporting and auditing. Qopy copies only the data inside each file and none of the metadata like ModifiedTime or ACLs.

Two Cmdlets are exported.

NAME
	Copy-Files

SYNOPSIS
	A Powershell File Copy Module with CRC Check.

SYNTAX
	Copy-Files [-Source] <string> [-Destination] <string> [[-Filter] <string>]
	[[-Recurse]] [[-SetTime]] [[-Overwrite]] [[-ShowProgress]]  [<CommonParameters>]


NAME
	Get-CopyResultsReport

SYNOPSIS
	Aggregate output of Copy-Files

SYNTAX
	Get-CopyResultsReport -InputObject <FileCopyResultsItem>
	[<CommonParameters>]		

The output is an object list with the following properties�One object per source file.

   TypeName: Qopy.FileCopyResultsItem

Name           MemberType Definition
----           ---------- ----------
Destination    Property   string Destination {get;set;}
DestinationCRC Property   string DestinationCRC {get;set;}
ErrorMessage   Property   string ErrorMessage {get;set;}
Match          Property   bool Match {get;set;}
Size           Property   long Size {get;set;}
Source         Property   string Source {get;set;}
SourceCRC      Property   string SourceCRC {get;set;}
Time           Property   timespan Time {get;set;}

Get-CopyResultsReport returns the following properties.

TypeName: Qopy.FileCopyResultsReport

Name           MemberType Definition
----           ---------- ----------
Bytes          Property   long Bytes {get;set;}
FailedItemList Property   System.Collections.Generic.List[Qopy.FileCopyResultsItem]
FileCount      Property   int FileCount {get;set;}
TotalTime      Property   timespan TotalTime {get;set;}	

Features

  • Attempts to not copy files when unnecessary.
    • If file size is different and Overwrite switch is not enabled, do not copy.
    • If file size is the same and CRC check is the same, do not copy.
  • Validates source and destination contents match

CRC-32 functionality was developed by Damien Guard - Calculating CRC-32 in C# and .NET

Performance

Test Case: 1,797 Files in 145 Folders 108MB

Local System
TeraCopy w/Test 1:01
Qopy 0:27

LAN
TeraCopy w/Test 2:02
Qopy 1:31

Changes

1.0.3

  • Added the SetTime switch to copy timestamp metadata. This increases copy time by as much as 300%.

1.0.2

  • Changed error output to use WriteVerbose. This prevents terminating errors. Add the -Verbose switch to expose.
  • Added ErrorMessage property to the FileCopyResultsItem class to capture copy errors.

1.0.1

  • Removed some unnecessary IO by eliminating redundant file existence checks. Should improve network file copy performance a little bit.

Todo

  • A bunch of code clean-up
  • Update Progress bar to use Bytes instead of File Count
  • Move (delete source)?
  • Validate only?
  • Do not Validate?

Use

Requires Powershell v3.

Binary Download

  1. Extract to C:\Users\[username]\Documents\WindowsPowerShell\Modules
  2. Import-Module Qopy

If you use the ShowProgress switch without capturing the Output, the screen will get very flashy.

qopy's People

Contributors

cdhunt avatar

Watchers

James Cloos avatar Uday Santosh Kumar Thathapudi avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.