3 # $RCSfile: findcp,v $$Revision: 4.1 $$Date: 92/08/07 17:20:12 $
5 # This is a wrapper around the find command that pretends find has a switch
6 # of the form -cp host:destination. It presumes your find implements -ls.
7 # It uses tar to do the actual copy. If your tar knows about the I switch
8 # you may prefer to use findtar, since this one has to do the tar in batches.
11 `tar cf - $list | rsh $desthost cd $destdir '&&' tar xBpf -`;
14 $sourcedir = $ARGV[0];
15 if ($sourcedir =~ /^\//) {
17 unless (chdir($sourcedir)) { die "Can't find directory $sourcedir: $!"; }
20 $args = join(' ',@ARGV);
21 if ($args =~ s/-cp *([^ ]+)/-ls/) {
23 if ($dest =~ /(.*):(.*)/) {
28 die "Malformed destination--should be host:directory";
32 die("No destination specified");
35 open(find,"find $args |") || die "Can't run find for you: $!";
39 if ($x[2] =~ /^d/) { next;}
40 chop($filename = $x[10]);
41 if (length($list) > 5000) {