Some changes

This commit is contained in:
Dennis Schwerdel 2017-03-29 22:13:28 +02:00 committed by Dennis Schwerdel
parent 7294e7edf6
commit bbafe64f85
2 changed files with 3 additions and 5 deletions

View File

@ -239,7 +239,7 @@ pub fn parse() -> Arguments {
(about: "creates a new backup")
(@arg full: --full "create a full backup")
(@arg reference: --ref +takes_value "the reference backup to use for partial backup")
(@arg same_device: --xdev -x "do not cross filesystem boundaries")
(@arg cross_device: --xdev -x "allow to cross filesystem boundaries")
(@arg exclude: --exclude -e ... +takes_value "exclude this path or file")
(@arg excludes_from: --excludesfrom +takes_value "read the list of exludes from this file")
(@arg no_default_excludes: --nodefaultexcludes "do not load the default excludes file")
@ -361,7 +361,7 @@ pub fn parse() -> Arguments {
repo_path: repository.to_string(),
backup_name: backup.unwrap().to_string(),
full: args.is_present("full"),
same_device: args.is_present("same_device"),
same_device: !args.is_present("cross_device"),
excludes: args.values_of("exclude").map(|v| v.map(|k| k.to_string()).collect()).unwrap_or_else(|| vec![]),
excludes_from: args.value_of("excludes_from").map(|v| v.to_string()),
src_path: args.value_of("SRC").unwrap().to_string(),

View File

@ -177,9 +177,7 @@ impl Inode {
inode.mode = meta.st_mode();
inode.user = meta.st_uid();
inode.group = meta.st_gid();
inode.access_time = meta.st_atime();
inode.modify_time = meta.st_mtime();
inode.create_time = meta.st_ctime();
Ok(inode)
}
@ -208,7 +206,7 @@ impl Inode {
).map_err(|e| InodeError::SetPermissions(e, full_path.clone(), self.mode)));
try!(filetime::set_file_times(
&full_path,
FileTime::from_seconds_since_1970(self.access_time as u64, 0),
FileTime::from_seconds_since_1970(self.modify_time as u64, 0),
FileTime::from_seconds_since_1970(self.modify_time as u64, 0)
).map_err(|e| InodeError::SetTimes(e, full_path.clone())));
try!(chown(&full_path, self.user, self.group).map_err(|e| InodeError::SetOwnership(e, full_path.clone())));