File tree Expand file tree Collapse file tree 1 file changed +2
-9
lines changed
Expand file tree Collapse file tree 1 file changed +2
-9
lines changed Original file line number Diff line number Diff line change @@ -38,19 +38,12 @@ Write-Host "Backing up the Database: '$databaseName' to local directory: $backup
3838
3939# ATTENTION ⚠: Use the absolute path if you haven't added mongo to your System Path
4040# Ex: C:\mongodb\bin\mongodump.exe -h $mongoDbHost -d $databaseName -o "$directoryPath"
41- mongodump - h " $mongoDbHost " - d " $databaseName " - o " $directoryPath "
41+ # Version 3.2 introduced gzip & archive
42+ mongodump -- gzip - h " $mongoDbHost " - d " $databaseName " - o " $directoryPath "
4243
4344Write-Host " Creating the backup for $databaseName ..."
4445
4546$watch.Stop ();
4647Write-Host " MongoDB backup completed in " $watch.Elapsed.ToString ()
4748
48- # Zip sfolder
49- Write-Host " Zipping the folder backup folder..."
50- Compress-Archive - Path " $directoryPath " - DestinationPath $zippedFileDestinationPath
51-
52- # Delete the backup folter created
53- Write-Host " Delete backup's folder"
54- Remove-Item " $directoryPath " - Recurse
55-
5649# endregion
You can’t perform that action at this time.
0 commit comments