Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

RCP files

by ngraham (Initiate)
on May 30, 2002 at 05:02 UTC ( #170312=snippet: print w/replies, xml ) Need Help??
Description: Quick program to rcp files to other hosts. Makes backup of old file first then copies across.
#!/bin/perl

$bbproctab="bb-proctab";
$bbproctab_bkp="bb-proctab.bkp";
$dir="/export/home/bbuser/bb/etc";
$rcp="/bin/rcp";
$rsh="/bin/rsh";

@hosts = (host1,host2,host3);
foreach $host(@hosts)
{
 `$rsh $host mv $dir/$bbproctab $dir/$bbproctab_bkp`;
 `$rcp $bbproctab $host:$dir`;
 print "$rcp $bbproctab $host:$dir\n";
}
Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: snippet [id://170312]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (2)
As of 2018-07-21 06:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    It has been suggested to rename Perl 6 in order to boost its marketing potential. Which name would you prefer?















    Results (444 votes). Check out past polls.

    Notices?