Skip to content

Instantly share code, notes, and snippets.

@spy86
Created August 3, 2017 10:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save spy86/e5ac1a059a2b062bee9d9531b06637ff to your computer and use it in GitHub Desktop.
Save spy86/e5ac1a059a2b062bee9d9531b06637ff to your computer and use it in GitHub Desktop.
$date = Get-Date -UFormat %Y-%m-%d;
$backupFolder = $date;
$basePath = "F:\mongodb_backup";
$destinationPath = Join-Path $basePath $backupFolder;
if(!(Test-Path -Path $destinationPath)) {
New-Item -ItemType directory -Path $destinationPath;
(C:\mongodump.exe --out $destinationPath);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment