Skip to content

Instantly share code, notes, and snippets.

@dotnetchris
Created September 5, 2012 12:47
Show Gist options
  • Save dotnetchris/3636052 to your computer and use it in GitHub Desktop.
Save dotnetchris/3636052 to your computer and use it in GitHub Desktop.
Simple ravendb backup script
$dest = "F:\Backup\Runs\backup-"+(Get-Date).ToString("yyyy-MM-dd HHmm")
.\Raven.Backup.exe --url=http://localhost/ --dest=$dest
& 'C:\Program Files\7-Zip\7z.exe' a $dest $dest
Remove-Item -Recurse $dest
@dotnetchris
Copy link
Author

Simple ravendb backup script meant for running daily or hourly backups, create this as a backup.ps1 file and you can schedule using the built in windows scheduler, make sure to set the task up in scheduler to run as administrator with elevated rights properly.

This will then 7zip the backup results (generally a 5-10:1 compression ratio easily) and then removes the original files. If you want the original files just delete the remove-item call.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment