文件操作 - files-to-excludes
返回文件管理
返回主菜单
删除本文件
文件: /usr/share/rsync/scripts/files-to-excludes
编辑文件内容
#!/usr/bin/perl # This script takes an input of filenames and outputs a set of # include/exclude directives that can be used by rsync to copy # just the indicated files using an --exclude-from=FILE option. use strict; my %hash; while (<>) { chomp; s#^/+##; my $path = '/'; while (m#([^/]+/)/*#g) { $path .= $1; print "+ $path\n" unless $hash{$path}++; } if (m#([^/]+)$#) { print "+ $path$1\n"; } else { delete $hash{$path}; } } foreach (sort keys %hash) { print "- $_*\n"; } print "- /*\n";
修改文件时间
将文件时间修改为当前时间的前一年
删除文件