mirror of
https://github.com/Portabase/agent.git
synced 2026-10-20 03:11:34 +00:00
fix: use local time for the backup date folder
The remote path date folder used UTC, so backups taken after local midnight in non-UTC zones landed in the previous day's folder. Use the container timezone (TZ), like the scheduler already does. Refs Portabase/portabase#330
This commit is contained in:
+2
-2
@@ -1,7 +1,7 @@
|
||||
#![allow(dead_code)]
|
||||
|
||||
use anyhow::Result;
|
||||
use chrono::Utc;
|
||||
use chrono::Local;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use std::path::{Path, PathBuf};
|
||||
use tokio::fs::File;
|
||||
@@ -54,7 +54,7 @@ pub fn full_file_path(file_name: &String, folder_name: Option<&str>) -> String {
|
||||
.filter(|folder_name| !folder_name.is_empty())
|
||||
.unwrap_or("backups");
|
||||
|
||||
format!("{}/{}/{}", folder_name, Utc::now().format("%Y-%m-%d"), file_name)
|
||||
format!("{}/{}/{}", folder_name, Local::now().format("%Y-%m-%d"), file_name)
|
||||
}
|
||||
|
||||
const CHUNK_SIZE: usize = 16 * 1024 * 1024;
|
||||
|
||||
Reference in New Issue
Block a user