Server IP : 192.185.129.71 / Your IP : 3.137.208.89 Web Server : Apache System : Linux bh-ht-3.webhostbox.net 4.19.286-203.ELK.el7.x86_64 #1 SMP Wed Jun 14 04:33:55 CDT 2023 x86_64 User : svymadmin ( 4072) PHP Version : 7.4.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON Directory (0755) : /usr/share/doc/rsync-3.1.2/support/ |
[ Home ] | [ C0mmand ] | [ Upload File ] |
---|
#!/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";