Skip to content
Snippets Groups Projects
Commit e4f86684 authored by Gerhard Gonter's avatar Gerhard Gonter :speech_balloon:
Browse files

added notify via sms

parent 484e1641
No related branches found
No related tags found
No related merge requests found
...@@ -65,6 +65,8 @@ while (my $arg= shift (@ARGV)) ...@@ -65,6 +65,8 @@ while (my $arg= shift (@ARGV))
else { push (@PARS, $arg); } else { push (@PARS, $arg); }
} }
notify('starting wdq0 loop');
while (1) while (1)
{ {
my $dumps= check(); my $dumps= check();
...@@ -81,6 +83,13 @@ while (1) ...@@ -81,6 +83,13 @@ while (1)
exit (0); exit (0);
sub notify
{
my $msg= shift;
system (qw(notify-sms.pl gg-uni), $msg);
}
sub fetch_and_convert sub fetch_and_convert
{ {
my $date= shift; my $date= shift;
...@@ -97,6 +106,7 @@ sub fetch_and_convert ...@@ -97,6 +106,7 @@ sub fetch_and_convert
else else
{ {
print "fetching stuff for $date\n"; print "fetching stuff for $date\n";
notify('wdq0: this is a test send from w4.urxn.at');
my ($fetched, $dump_file)= fetch_dump ($date); my ($fetched, $dump_file)= fetch_dump ($date);
if ($fetched) if ($fetched)
...@@ -123,17 +133,22 @@ sub fetch_and_convert ...@@ -123,17 +133,22 @@ sub fetch_and_convert
return undef; return undef;
} }
notify ('wdq0: finished download, starting wdq1');
my @cmd1= (qw(./wdq1.pl --date), $date); my @cmd1= (qw(./wdq1.pl --date), $date);
print "cmd1: [", join (' ', @cmd1), "]\n"; print "cmd1: [", join (' ', @cmd1), "]\n";
system (@cmd1); system (@cmd1);
notify ('wdq0: finished wdq1, starting wdq2');
my @cmd2= (qw(./wdq2.pl --scan --date), $date); my @cmd2= (qw(./wdq2.pl --scan --date), $date);
print "cmd2: [", join (' ', @cmd2), "]\n"; print "cmd2: [", join (' ', @cmd2), "]\n";
system (@cmd2); system (@cmd2);
notify ('wdq0: finished wdq2, starting wdq3');
my @cmd3= (qw(./wdq3.pl --date), $date); my @cmd3= (qw(./wdq3.pl --date), $date);
print "cmd3: [", join (' ', @cmd3), "]\n"; print "cmd3: [", join (' ', @cmd3), "]\n";
system (@cmd3); system (@cmd3);
notify ('wdq0: finished wikidata conversion');
} }
} }
...@@ -181,7 +196,7 @@ sub check ...@@ -181,7 +196,7 @@ sub check
if (m#<a href="((\d{4})(\d{2})(\d{2})\.json\.gz)">(\d{8}\.json\.gz)</a>\s+(\S+)\s+(\S+)\s+(\d+)#) if (m#<a href="((\d{4})(\d{2})(\d{2})\.json\.gz)">(\d{8}\.json\.gz)</a>\s+(\S+)\s+(\S+)\s+(\d+)#)
{ {
my ($f1, $year, $mon, $day, $f2, $xdate, $time, $size)= ($1, $2, $3, $4, $5, $6, $7, $8); my ($f1, $year, $mon, $day, $f2, $xdate, $time, $size)= ($1, $2, $3, $4, $5, $6, $7, $8);
print "year=[$year] mon=[$mon] day=[$day] f1=[$f1] f2=[$f2] xdate=[$xdate] time=[$time] size=[$size]\n"; # print "year=[$year] mon=[$mon] day=[$day] f1=[$f1] f2=[$f2] xdate=[$xdate] time=[$time] size=[$size]\n";
my $rec= my $rec=
{ {
dump_file => $f1, dump_file => $f1,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment