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:
Charles Gauthereau
2026-10-17 19:35:52 +02:00
parent 56102b544f
commit f639cccd8b
+2 -2
View File
@@ -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;