[mrtg] Re: Backup Script

Alistair.McGlinchy at marks-and-spencer.com Alistair.McGlinchy at marks-and-spencer.com
Thu Sep 6 16:30:23 MEST 2001


Edgardo,

Here's my simplistic solution that runs on NT.

Alistair

use strict;
my $interval=24*60*60;  # Every 24 hours
my $offset=  3600 *2;   # At 2 hours after midnight 
while (1) {  
	print "Beginning Backup:".localtime()."...\n";
	system "xcopy c:\\mrtg\\active\\*.*  c:\\mrtgbackup /s ";
	print "\nEnding Backup:".localtime()."...\n";	

	my $sleeptime=($interval - (time()+ 3600 *(localtime)[8]) %
$interval)+$offset;
	print "Sleeping for $sleeptime seconds. Back at
".localtime(time()+$sleeptime)."\n";
	sleep($sleeptime);
}

> -----Original Message-----
> From:	Edgardo Mina [SMTP:edgardo at staff.singnet.com.sg]
> Sent:	Wednesday, September 05, 2001 5:14 AM
> To:	MRTG
> Subject:	[mrtg] Backup Script
> 
> 
> 
> Hi Guys,
> 
> do you know of any script that can do backup of mrtg graphs on a daily
> basis.
> 
> 
> thanks and regards,
	Edgardo


> --
> Unsubscribe mailto:mrtg-request at list.ee.ethz.ch?subject=unsubscribe
> Archive     http://www.ee.ethz.ch/~slist/mrtg
> FAQ         http://faq.mrtg.org    Homepage     http://www.mrtg.org
> WebAdmin    http://www.ee.ethz.ch/~slist/lsg2.cgi
__________________________________________________________________________________________

Registered Office:
Marks and Spencer p.l.c
Michael House, Baker Street,
London, W1U 8EP
Registered No. 214436 in England and Wales.

Telephone  (020) 7935 4422
Facsimile  (020) 7487 2670

www.marksandspencer.com

Please note that electronic mail may be monitored.

This e-mail is confidential. If you received it by mistake, please let us know and then
delete it from your system; you should not copy, disclose, or distribute its contents to
anyone nor act in reliance on this e-mail, as this is prohibited and may be unlawful
_________________________________________________________________________________________

--
Unsubscribe mailto:mrtg-request at list.ee.ethz.ch?subject=unsubscribe
Archive     http://www.ee.ethz.ch/~slist/mrtg
FAQ         http://faq.mrtg.org    Homepage     http://www.mrtg.org
WebAdmin    http://www.ee.ethz.ch/~slist/lsg2.cgi



More information about the mrtg mailing list