GithubHelp home page GithubHelp logo

ned-martin / crashplan-hardlink Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 1.0 4 KB

Create hardlinks to files CrashPlan won’t otherwise backup.

PowerShell 100.00%
backup backup-script crashplan code42 powershell powershell-module powershell-script

crashplan-hardlink's Introduction

CrashPlan-HardLink

A Powershell module to create hardlinks to files so CrashPlan can back them up.

If you would rather rename files, you can do that using Rename-CrashPlan instead.

Reason

Despite their advertising (“Never worry about losing business-critical data again”, “Confidence that your files are backed up safely”, “Simplifies and streamlines all of your data backups”, …) CrashPlan actually restricts the types of files that can be backed up, so cannot be used as a complete backup solution.

See What am I not allowed to back up? for a list of all the things you are not able to backup using CrashPlan.

This Powershell script will create hardlinks to some of the file types that CrashPlan refuses to back up, using filenames that CrashPlan will back up, so that they can be backed up.

Usage

Open Powershell, navigate to the directory containing the files you wish to rename, and type:

CrashPlan-HardLink [-Create] [-Remove] [-Force] [-WhatIf]

This will search the current directory and all child directories for any files matching any of the forbidden filetypes, and will:

Default

By default this will list any found files, and any existing hardlink files previously created by this.

-Create

With the -Create flag, hardlinks to the existing forbidden files will be created.

-Remove

With the -Remove flag, previously created hardflink files will be removed.

-Force

The -Force flag will skip confirmation.

-WhatIf

The -WhatIf flag shows what would happen if run, but does not actually do it.

How It Works

Hardlinks to forbidden filetypes are created as below:

My Important Data.hardlink-vhdMy Important Data.vhd

A log file CrashPlan-HardLink.log is created in the directory the command is run from, listing all the files that were created or removed.

Installation

The simplest way is to Download this module and put it in one of the default module locations. Powershell will then autoload the module.

Alternatively, one can manually load the module.

Autoload

  1. To view the default module locations, type:
    $Env:PSModulePath
    1. To add a default module location, type:
      $Env:PSModulePath = $Env:PSModulePath + ";<path>"
    2. To create a Modules directory for the current user if one does not exist, type:
      New-Item -Type Directory -Path $HOME\Documents\WindowsPowerShell\Modules
  2. Copy the entire module folder into the Modules directory.
  3. You should now be able to use the module:
    CrashPlan-HardLink [-Create] [-Remove] [-Force] [-WhatIf]

Manual Load

To import a module that is not in a default module location, use the fully qualified path to the module folder in the command.

For example, to add the Rename-Crashplan module in the C:\My-Modules directory to your session, type:

Import-Module C:\My-Modules\Rename-Crashplan

Running Scripts is Disabled

If you get an error similar to The 'Rename-CrashPlan' command was found in the module 'Rename-CrashPlan', but the module could not be loaded. or Rename-CrashPlan.psm1 cannot be loaded because running scripts is disabled on this system then you may need to enable the running of unsigned scripts on your system:

  1. To get the effective execution policy for the current PowerShell session:
    Get-ExecutionPolicy
  2. To permanently change the execution policy:
    Set-ExecutionPolicy -ExecutionPolicy <PolicyName>
  3. To temporarily bypass the execution policy to allow running all scripts:
    powershell -ExecutionPolicy Bypass

Forbidden Filetypes

The filetypes which are handled by this script:

".bck",
".bkf",
".hdd",
".hds",
".nvram",
".ost",
".part",
".pvm",
".pvs",
".rbf",
".sparseimage",
".tib",
".tmp",
".vdi",
".vfd",
".vhd",
".vhdx",
".vmc",
".vmdk",
".vmem",
".vmsd",
".vmsn",
".vmss",
".vmtm",
".vmwarevm",
".vmx",
".vmxf",
".vsv",
".vud",
".xva"

crashplan-hardlink's People

Contributors

ned-martin avatar

Stargazers

 avatar

Watchers

 avatar

Forkers

cymad7001

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.