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.
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.
// Install DGL.GoogleDrive.SqlServer.Backup as a Cake Addin
#addin nuget:?package=DGL.GoogleDrive.SqlServer.Backup&version=1.0.6

// Install DGL.GoogleDrive.SqlServer.Backup as a Cake Tool
#tool nuget:?package=DGL.GoogleDrive.SqlServer.Backup&version=1.0.6
  • 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. 
.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,212 8/28/2023
1.0.5 112 8/28/2023
1.0.4 146 7/30/2023
1.0.3 139 7/30/2023
1.0.2 131 7/29/2023
1.0.0 149 7/28/2023