M
Manuel
Hello,
i was trying to create a script that checks if internet connection and
if it is off the perl script tries to connect again and lunch a perl
script.
it opens a txt file, get the timestamp. in $differenza i get the
difference between now and the timestamp in the txt file (in this file
i write with blog.pl the operation time timestamp ). if the difference
is more than 10000 seconds it means the connection is off so it tries
to connect again. and if the difference is more than 500 it start the
blog.pl process again. i did put this file in the crontab list:
*/1 * * * * perl /home/user/perl/crontab.pl
but the blog.pl never stars. Why???
this is the code of crontab.pl:
$ora_aggiornata=time();
open (CHECKBOOK, "timestamp.txt");
$timestamp = <CHECKBOOK>;
$differenza=$ora_aggiornata-$timestamp;
print "$differenza\n";
if ($differenza > 10000){
$ifc=`ifconfig | grep P-t-P`;
if ($ifc eq "") {
`poff dsl-provider`;
`sleep 1`;
`pon dsl-provider`;
}
}
if ($differenza > 500) {
exec("perl blog.pl &");
} else {
print "no not yet\n";
}
i was trying to create a script that checks if internet connection and
if it is off the perl script tries to connect again and lunch a perl
script.
it opens a txt file, get the timestamp. in $differenza i get the
difference between now and the timestamp in the txt file (in this file
i write with blog.pl the operation time timestamp ). if the difference
is more than 10000 seconds it means the connection is off so it tries
to connect again. and if the difference is more than 500 it start the
blog.pl process again. i did put this file in the crontab list:
*/1 * * * * perl /home/user/perl/crontab.pl
but the blog.pl never stars. Why???
this is the code of crontab.pl:
$ora_aggiornata=time();
open (CHECKBOOK, "timestamp.txt");
$timestamp = <CHECKBOOK>;
$differenza=$ora_aggiornata-$timestamp;
print "$differenza\n";
if ($differenza > 10000){
$ifc=`ifconfig | grep P-t-P`;
if ($ifc eq "") {
`poff dsl-provider`;
`sleep 1`;
`pon dsl-provider`;
}
}
if ($differenza > 500) {
exec("perl blog.pl &");
} else {
print "no not yet\n";
}