Giter Site home page Giter Site logo

skalyptosama / usb-drive-backup-script Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 20 KB

A Windows Powershell script, batch file and sheduled task to automatically backup a usb drive to a machine when it is inserted (based on monotone's script)

License: The Unlicense

PowerShell 81.63% Batchfile 18.37%
backup batch batch-script powershell-script public task-scheduler unlicense unlicense-license usb usb-devices

usb-drive-backup-script's Introduction

USB-backup

Windows PS Script and .bat to automatically backup a usb drive to a machine when it is inserted (based on monotone's script). Sources below.

Set up

To set up the automatic backup download Sync.bat, USB-backup.ps1 and USB-backup.xml

The batch file should go at the root your usb drive and the PS script can go anywhere you want on your machine.

Open Sync.bat with a text editor and change the backup folder path.

image

Same with USB-backup.ps1 and change 'Mirror' to your drive name.

image

Then in Windows Task Scheduler, select import task and open USB-backup.xml

Go to 'Actions' and 'Modify' and in the 'Arguments' delete whats after -File and enter the full path to USB-backup.ps1

image

You can also remove -WindowStyle Hidden if you want to see the powershell window.

image

The -ExecutionPolicy Bypass argument allows the script to run.

Sources

Monotone's script can be found here :

https://answers.microsoft.com/en-us/windows/forum/windows_vista-windows_programs/task-scheduler-how-to-automatically-synchronize-my/45a49d83-b1d8-4d37-8896-3d2696cf9795

image

image

Their work is based on these blog posts :

https://devblogs.microsoft.com/scripting/hey-scripting-guy-can-i-be-informed-when-a-portable-drive-is-added-by-my-computer/

https://devblogs.microsoft.com/scripting/hey-scripting-guy-can-i-format-a-portable-drive-when-it-is-inserted-into-a-computer/

usb-drive-backup-script's People

Contributors

skalyptosama 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.