perl $ File :::使用DSM 6.2.1在Synology上发现问题

时间:2018-12-04 14:06:29

标签: perl find synology

我想构建自己的文件索引并使用脚本,在特定的挂载点上运行以下命令

File::Find::find( {wanted => \&processFile}, @ARGV ) ;

processFile在哪里

sub processFile
{   my( $dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime,$ctime,$blksize,$blocks512) ;
    ( @X = lstat($_) ) ;
    return unless( $#X == 12 ) ;
    (($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime,$ctime,$blksize,$blocks512) = @X)
      && ! ( $prune |= ($dev != $File::Find::topdev) )
      && ($prune = 1)
      || print( LOG "$dev $ino $mode $nlink $uid $gid $rdev $size " . 512*$blocks512 . " $mtime $name\n" ) ;
}

这对于/,/ tmp和其他安装点效果很好,但无法下降到数据量/ volume2 / syno1中。
如果我添加一行打印$ dev和$ File :: find :: topdev的名称和值的行,则会得到以下信息:

/volume2 40 40
/volume2/syno1 41 40
/volume2/@eaDir 40 40
/volume2/@eaDir/snaptree.bin 40 40
/volume2/@eaDir/syno1 40 40
/volume2/@eaDir/syno1/SYNO@.attr 40 40
/volume2/@eaDir/syno1/SYNO@.quota 40 40
/volume2/@eaDir/syno1/BackupData 40 40
/volume2/@eaDir/syno1/BackupData/Record 40 40
/volume2/@eaDir/syno1/BackupData/Record/snapshot.record 40 40
/volume2/@eaDir/syno1/BackupData/img_backup_local_db 40 40
/volume2/@eaDir/syno1/BackupData/img_backup_local_db/001132168A71_3_1543860108 40 40
/volume2/@eaDir/syno1/BackupData/img_backup_local_db/001132168A71_3_1543860108/2.db 40 40
/volume2/@tmp 40 40
/volume2/@sharesnap 45 40

可以看出/ volume2 / syno1无法通过检查
/ volume2显示为安装点,syno1是常规子目录,但设置了Windows ACL,这是DSM 6上的默认值

ls -l /volume2
total 0
drwxrwxrwx+ 1 root root  34 Dec  4 09:26 @eaDir
drwxr-xr-x  1 root root  32 Dec  4 09:26 @sharesnap
d---------+ 1 root root 108 Dec  3 18:58 syno1
drwxrwxrwx  1 root root   0 Dec  4 09:26 @tmp

df /volume2 /volume2/syno1
Filesystem         1K-blocks       Used  Available Use% Mounted on
/dev/vg1/volume_2 4026531840 2980006684 1046525156  75% /volume2
-                 4026531840 2980006684 1046525156  75% /volume2/syno1

 mount /volume2
 mount: /dev/vg1/volume_2 is already mounted or /volume2 busy
        /dev/vg1/volume_2 is already mounted on /volume2

解决此问题的最佳方法是什么?

0 个答案:

没有答案