Giter VIP home page Giter VIP logo

mirror's Introduction

Mirror

Drive backup script in PowerShell with Shadow Copy support. Optional Jenkins project included.

Warning

Warning! The script completely erases the target drive! Only keeps files that are the same on the source drive. Do NOT run the script on drives you would like to preserve!

Usage

Open up PowerShell, navigate to the folder, and execute the command:

.\Mirror.ps1 sourceDrive: targetDrive: shadowDrive: -Verbose

Where sourceDrive is the drive you would like to backup, targetDrive is the backup drive, and shadowDrive is a free drive letter that will be used for a temporary snapshot of the source drive.

For example the following command will backup c: drive to d: drive with b: as the temporary drive letter:

.\Mirror.ps1 c: d: b: -Verbose

Usage in Jenkins

Download or fork the project, change Jenkinsfile to your preferences, and create a new pipeline job with it. Preferably do not clone the project because at any time I could make modifications that break your data.

mirror's People

Contributors

frigocoder avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Forkers

maindude111

mirror's Issues

Shadow Copy context Backup is not supported

Win32_ShadowCopy.Create method only accepts ClientAccessible and NASRollback context. Does not accept All, AppRollback, Backup, FileShareBackup context.

As a result, if the backup script crashes, the shadow copy is not removed, and causes data loss. When the Jenkins job was stuck and I had to abort it, the Jenkins log file was filled with zeroes after a certain point.

Find a goddamn workaround.

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.