#!/usr/bin/env perl
#
-# Copyright (C) 2000-2019 Kern Sibbald
+# Copyright (C) 2000-2020 Kern Sibbald
# License: BSD 2-Clause; see file LICENSE-FOSS
#
my $hash;
my $ret=0;
my $notop=0;
+my $plain=0;
GetOptions("src=s" => \$src, # source directory
"dst=s" => \$dst, # dest directory
"wattr" => \$wattr, # windows attributes
"mtime-dir" => \$mtimedir, # check mtime on directories
"exclude=s@" => \@exclude, # exclude some files
+ "plain" => \$plain, # compare plain files
"notop" => \$notop, # Exclude top directory
"help" => \$help,
) or pod2usage(-verbose => 1,
return;
}
if (-l $f) {
+ if ($plain) {
+ return;
+ }
my ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,
$atime,$mtime,$ctime,$blksize,$blocks) = lstat($f);
-
+ if ($^O ne 'linux') {
+ # for any OS that don't support lutimes()
+ $mtime = 0;
+ }
my $target = readlink($f);
$hash->{$File::Find::name} = {
nlink => $nlink,
uid => $uid,
gid => $gid,
- mtime => 0,
+ mtime => $mtime,
target => $target,
type => 'l',
file => $File::Find::name,
};
} elsif (-b $f or -c $f) { # dev
+ if ($plain) {
+ return;
+ }
$hash->{$File::Find::name} = {
mode => $mode,
uid => $uid,
};
} elsif (-p $f) { # named pipe
+ if ($plain) {
+ return;
+ }
$hash->{$File::Find::name} = {
mode => $mode,
uid => $uid,