Attached the perl script for your reference. Please note that it requires the lib from MRTG.
Fill in the IP in @hosts and the write community string in @test.
#!/usr/bin/perl -w
#use lib "c:\\mrtg\\lib\\mrtg2";
use SNMP_util;
my @hosts = (
'10.10.10.1',
'20.20.20.2',
);
sub DoMain {
my $host = shift;
my $community = shift;
my $ran = time();
my $composite = $community.'@'.$host.':::::2';
my ($hostname) = &snmpget($composite,'sysName');
# my ($hostname) = &snmpget($composite,'sysName');
if ($hostname =~ /\./) {
$hostname =~ s/^(.+?)\..*$/$1/;
}
my $file = $hostname."-confg";
$file =~ s/(.+)/\L$1\E/;
my @createngo = ($composite);
push @createngo, "ccCopyProtocol.$ran",'integer',1;
push @createngo, "ccCopySourceFileType.$ran",'integer',4;
push @createngo, "ccCopyDestFileType.$ran",'integer',1;
push @createngo, "ccCopyServerAddress.$ran", 'ipAddress', '30.30.30.1';
push @createngo, "ccCopyFileName.$ran",'octetstring',$file;
push @createngo, "ccCopyEntryRowStatus.$ran",'integer',4;
my @response = &snmpset(@createngo);
my @test = ($composite);
push @test, "ccCopyState.$ran";
push @test, "ccCopyEntryRowStatus.$ran";
push @test, "ccCopyFailCause.$ran";
return @test;
}
&snmpQueue_MIB_File("c:\\mib\\CISCO-SMI-V1SMI.my"

;
&snmpQueue_MIB_File("c:\\mib\\CISCO-CONFIG-MAN-MIB-V1SMI.my"

;
&snmpQueue_MIB_File("c:\\mib\\CISCO-CONFIG-COPY-MIB-V1SMI.my"

;
my @tests;
while ($#hosts >=0) {
while ($#tests < 5) {
last if $#hosts == -1;
$h = shift @hosts;
push @tests, [ &DoMain($h,'public') ] ;
}
$t = shift @tests;
my @rt = &snmpget(@$t);
foreach my $r (@rt) {
print $r ."\n";
}
if ($rt[0] == 2) { push @tests, $t}
}
exit;