#!/usr/bin/perl $BackupScripts=`pwd`; chomp $BackupScripts; $BackupSettings="$BackupScripts/settings"; if (-f "$BackupSettings/settings.pl") { do "$BackupSettings/settings.pl"; } $TabFile=$ARGV[0]; chomp $TabFile; $Verbose="no"; if ($ARGV[1] =~ /--verbose/) { $Verbose="yes"; } open (TABFILE, "$TabFile") || die "Can't open tabfile $TabFile.\n"; if ($Verbose eq "yes") { print "Getting system info...\n"; } while () { $Line=$_; chomp $Line; if ($Line !~ /^#/) { ($HostName,$RemoteCommand,$OutFile)=split (/:/,$Line,4); if ($Verbose eq "yes") { print "$HostName:$RemoteCommand > $BackupRoot/$HostName/$OutFile\n"; } open (OUTFILE, "> $BackupRoot/$HostName/$OutFile"); open (OUTPUT, "ssh $HostName $RemoteCommand |"); while () { print (OUTFILE $_); } close (OUTPUT); close (OUTFILE); } } close (TABFILE);