Giter VIP home page Giter VIP logo

data_mirroring_script's Introduction

Directory Mirroring Script ๐Ÿ’พ

This script synchronizes one or more source directory/-ies (variable $sourceDirs) with one destination directory (variable $destDir) recursively. The script will not create a new version folder for each mirroring process. Instead the source directories will be synced with the same destination every time. The directory structure of the source directory/-ies will be mirrored 1:1 in the destination directory. Before the sync process starts the availability of the target and the source directory/-ies is tested. Any changes made to the source directory will be applied to the destination directory. Internally, powershell prepares the mirroring process and Windows' robocopy does the actual work. All activities are logged in a seperate log file (variable $logpath). View the ps1-file for more information.

Syntax

powershell.exe -noexit -Mta "sync_files.ps1" [auto] [shutdown] [logginglevel]

-auto: The script runs without user interaction. If not provided the user will be prompted to confirm.
-shutdown: System shutdown immediately after the script has terminated. Even if an error was thrown.
-logginglevel: (1) Only write to logfile (2) Write to logfile and display in console (default)

How do I make this work?

  1. Set the variables $sourceDirs and $destDir to your desired directories.
  2. Launch the script using the command and the optional paramters above

I recommend hooking up the command to the windows task scheduler together with the -auto parameter or to call the script manually via a shortcut along with the -shutdown parameter.

data_mirroring_script's People

Contributors

max-schmeling avatar

Stargazers

Jimmy Briggs avatar

Watchers

 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.