This commit is contained in:
JMARyA 2025-01-05 10:24:12 +01:00
parent 8d0c0a5426
commit 96eec3a432
Signed by: jmarya
GPG key ID: 901B2ADDF27C2263
3 changed files with 3 additions and 11 deletions

View file

@ -44,9 +44,6 @@ exclude_if_present = [".nobackup"]
# Stay in one filesystem # Stay in one filesystem
one_file_system = true one_file_system = true
# Backup access time
atime = false
# Backup change time # Backup change time
ctime = false ctime = false

View file

@ -13,7 +13,9 @@ pub fn init_repo(path: &str) {
pub fn create_archive(conf: &BorgConfig) { pub fn create_archive(conf: &BorgConfig) {
let archive_name = format!( let archive_name = format!(
"BK_{}_{}_{}", "BK_{}_{}_{}",
std::fs::read_to_string("/etc/hostname").unwrap_or(String::from("UNKNOWN")), std::fs::read_to_string("/etc/hostname")
.map(|x| x.trim().to_string())
.unwrap_or(String::from("UNKNOWN")),
conf.src.join("+++"), conf.src.join("+++"),
nowtime() nowtime()
); );
@ -44,12 +46,6 @@ pub fn create_archive(conf: &BorgConfig) {
cmd.push("--one-file-system"); cmd.push("--one-file-system");
} }
if conf.atime.unwrap_or_default() {
cmd.push("--atime");
} else {
cmd.push("--noatime");
}
if !conf.ctime.unwrap_or(true) { if !conf.ctime.unwrap_or(true) {
cmd.push("--noctime"); cmd.push("--noctime");
} }

View file

@ -32,7 +32,6 @@ pub struct BorgConfig {
pub exclude: Option<Vec<String>>, pub exclude: Option<Vec<String>>,
pub exclude_if_present: Option<Vec<String>>, pub exclude_if_present: Option<Vec<String>>,
pub one_file_system: Option<bool>, pub one_file_system: Option<bool>,
pub atime: Option<bool>,
pub ctime: Option<bool>, pub ctime: Option<bool>,
pub no_acls: Option<bool>, pub no_acls: Option<bool>,
pub no_xattrs: Option<bool>, pub no_xattrs: Option<bool>,