Location: PHPKode > scripts > Cisco Config Copy > cisco-config-copy/Sample.php
<?PHP

require_once dirname(__FILE__).'/ConfigCopy.class.php';


$timeout = 60;
$community = "RWcommunity";
$tftphost = "192.168.1.254";
$dirname = "config-backup/".time()."/";

echo $dirname,"\n";

/* Create backup Directory */
mkdir("/tftpboot/".$dirname, 0777); // Directory MUST be rwx for all users
chmod("/tftpboot/".$dirname, 0777); // Directory MUST be rwx for all users


/* Create host list */

$device = array (0 => "192.168.1.1", 1 => "192.168.1.2", 2 => "192.168.1.3");

/* Process each host */

$CC = new CiscoConfigCopy();

$cnt_row = count($device);
$cnt=0;
echo "Processing ",$cnt_row," devices....\n\n";

while($cnt < $cnt_row){
        $CC->do_config_backup($device[$cnt], $community, $timeout, $tftphost, $dirname, $cnt+1);
        $cnt++;
}


?>
Return current item: Cisco Config Copy