WIP: backup fix
This commit is contained in:
@@ -41,6 +41,7 @@ public class AdminController : Controller
|
||||
const string formatMediaName = $"DatabaseToolkitBackup_{databaseName}";
|
||||
const string formatName = $"Full Backup of {databaseName}";
|
||||
|
||||
/*
|
||||
var connection = new SqlConnection(_configuration.GetConnectionString("SQLDatabase"));
|
||||
|
||||
const string sql = """
|
||||
@@ -62,15 +63,15 @@ public class AdminController : Controller
|
||||
command.Parameters.AddWithValue("@formatName", formatName);
|
||||
|
||||
command.ExecuteNonQuery();
|
||||
|
||||
*/
|
||||
var body = new Google.Apis.Drive.v3.Data.File
|
||||
{
|
||||
Name = Path.GetFileName(localDatabasePath),
|
||||
Parents = new List<string?> { _configuration["GDriveBackupDirectory"] },
|
||||
Parents = new List<string?> { "1ANm0pokPFgBw7vIaxLgDWXqznl3UjVvJ" },
|
||||
MimeType = "application/octet-stream"
|
||||
};
|
||||
|
||||
var fsSource = new FileStream(localDatabasePath, FileMode.Open, FileAccess.Read);
|
||||
var fsSource = new FileStream("/Users/mz/Projects/Diuna/diunabi-morska-9.bak", FileMode.Open, FileAccess.Read);
|
||||
|
||||
if (_googleDriveHelper.Service is null)
|
||||
{
|
||||
@@ -79,7 +80,7 @@ public class AdminController : Controller
|
||||
|
||||
var request = _googleDriveHelper.Service.Files.Create(body, fsSource, body.MimeType);
|
||||
request.Fields = "id";
|
||||
|
||||
|
||||
request.Upload();
|
||||
|
||||
_logsController.AddEntry(new LogEntry
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
"appLogsFile": "13PuDvS3_HAYoSLOCgKexzlzIDLUilkApUF8QiJMTae0",
|
||||
"apiLocalUrl": "localhost:5400",
|
||||
"dbBackupFile": "/home/mz/backups/diunabi-morska",
|
||||
"GDriveBackupDirectory": "1FEcdtVcF2cuqCROdq-vlBNs__th1M8_P",
|
||||
"GDriveBackupDirectory": "1ANm0pokPFgBw7vIaxLgDWXqznl3UjVvJ",
|
||||
"Kestrel": {
|
||||
"Endpoints": {
|
||||
"Http": {
|
||||
|
||||
Reference in New Issue
Block a user