Skip to content

Create hardlinks to files CrashPlan won’t otherwise backup.

Notifications You must be signed in to change notification settings

ned-martin/CrashPlan-HardLink

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 

Repository files navigation

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"

Releases

No releases published

Packages