I have a situation where I have many linux boxes that I would like to copy the contents of a folder to all the other boxes. I am trying to write a perl script to do this, here is what I have so far. is there a better way of doing versus entering each destination server? so there is one source server that will be going to 10 destination servers, same files.
Code:
#!/usr/bin/perl
use File::Copy;
print "content-type: text/html \n\n"; #Header
$PATH1 = "\\firewall_name\home\folder"; #source folder of firewall files
$PATH2 = "\\firewall_name\home\folder"; #destination folder of firewall files
$file_to_copy = "firewall_file";
$file_to_firewall = "firewall_file";
copy("$PATH1/$file_to_copy", "PATH2/$file_to_firewall") or die "File cannot be copied.";