DGL.GoogleDrive.SqlServer.Backup 1.0.6

dotnet add package DGL.GoogleDrive.SqlServer.Backup --version 1.0.6
                    
NuGet\Install-Package DGL.GoogleDrive.SqlServer.Backup -Version 1.0.6
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="DGL.GoogleDrive.SqlServer.Backup" Version="1.0.6" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="DGL.GoogleDrive.SqlServer.Backup" Version="1.0.6" />
                    
Directory.Packages.props
<PackageReference Include="DGL.GoogleDrive.SqlServer.Backup" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add DGL.GoogleDrive.SqlServer.Backup --version 1.0.6
                    
#r "nuget: DGL.GoogleDrive.SqlServer.Backup, 1.0.6"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package DGL.GoogleDrive.SqlServer.Backup@1.0.6
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=DGL.GoogleDrive.SqlServer.Backup&version=1.0.6
                    
Install as a Cake Addin
#tool nuget:?package=DGL.GoogleDrive.SqlServer.Backup&version=1.0.6
                    
Install as a Cake Tool
  • Backup database
  • Upload files to google drive

The job will run daily at 1AM.

How to use

  1. Add settings in appsettings.json:
{
	"GoogleDriveUploading": {
		"Enabled": false,
		"BackupItems": [ // backup bak file in sql server
		  {
			"Enabled": false,
			"ConnectionString": "",
			"DatabaseName": "",
			"DestinationFolderPath": "/var/opt/mssql/data", // backing up db in linux machine
			"BackupFileNamePrefix": "" // Backup file name = $"{BackupFileNamePrefix}_{ddmmyyyy_hhMMss}.bak"
		  }
		],
		"GoogleDriveUploaders": [ // uploading file to google drive named: $"{FileZipNamePrefix}_{ddmmyyyy_hhMMss}.zip"
		  {
			"Enabled": true,
			"OAuth_Client_Secret": "GooleDriveClientSecret\\OAuth_client_secret.json", // OAuth client secret getting in Google Cloud
			"FolderId": "", // FolderId of Google Drive
			"FileZipNamePrefix": "",
			"FileInforItems": [ // list files which want to zip
			  {
				"Enabled": true,
				"FolderPath": "",
				"FilePrefix": "" // Backup file name = $"{BackupFileNamePrefix}_{ddmmyyyy_hhMMss}.bak"
			  }
			],
			"KeepFileInDays": 7 // Only keep files for 7 days
		  }
		]
    }
}
  1. Register Hosted Service:
WebHost.CreateDefaultBuilder(args)
                  .ConfigureDGLGoogleDriveSqlServerHostedService()
                  .UseStartup<Startup>()
                  .UseSerilog()
                  .Build();
  1. Add DI: services.ConfigureDGLGoogleDriveSqlserverDatabaseBackup(Configuration)

Manually execute:

  • Inject IDGLDatabaseBackupService
  • Run method: DoWorkAsync
Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Core netcoreapp3.1 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.6 1,365 8/28/2023
1.0.5 221 8/28/2023
1.0.4 264 7/30/2023
1.0.3 252 7/30/2023
1.0.2 257 7/29/2023
1.0.0 272 7/28/2023