[Dxspider-support] Prefix data update automation.

Joaquin . joaquin at cronux.net
Wed Jan 22 19:54:24 CET 2020


Hi Bastien,

For the update of files I am using the crontab file located in
/spider/local_cmd
Look at the following example:

# AutoUpdate USDB
0 2 * * 1,3,5 spawn("cd /tmp; wget -qN ftp://ftp.w1nr.net/usdbraw.gz &;
/spider/perl/create_usdb.pl usdbraw.gz")
5 2 * * 1,3,5 run_cmd("load/usdb")
10 2 * * 1,3,5 spawn("rm /tmp/usdbraw.gz")

# AutoUpdate Keps
0 2 * * 2,4,6 spawn("cd /tmp; wget -qN
http://www.amsat.org/amsat/ftp/keps/current/nasabare.txt &; /spider/perl/
convkeps.pl -p nasabare.txt &")
5 2 * * 2,4,6 run_cmd("load/keps")
10 2 * * 2,4,6 spawn("rm /tmp/nasabare.txt")

# AutoUpdate CTY.DAT
0 3 * * 0,2,5 spawn("cd /spider/data; wget -qN
http://www.country-files.com/cty/cty.dat &")
0 3 * * 0,2,5 spawn("cd /spider/data; wget -qN
http://www.country-files.com/cty/wpxloc.dat &")
0 3 * * 0,2,5 spawn("cd /spider/data; wget -qN
http://www.country-files.com/cty/wpxloc.raw &")
2 3 * * 0,2,5 spawn("cd /spider/data; /spider/perl/create_prefix.pl")
3 3 * * 0,2,5 run_cmd("load/prefix")

In relation to stop/restart/status of the cluster, as you have been told it
is best to use systemd or service dxspider start|stop|restart|status

Kin 73, EA3CV

El mié., 22 ene. 2020 a las 18:26, Bastien F4EYQ via Dxspider-support (<
dxspider-support at tobit.co.uk>) escribió:

>
> Hello to all,
>
> I've write this script for data update, it run every week via a cron and
> do the job.
>
> My question is :  is there any other method to reload the dxspider ?
> i'm using this  :
>
> #restart dxspider :
> PID=$(cat /spider/local/cluster.lck);
> kill -KILL $PID;
> rm -f /spider/local/cluster.lck
> /bin/su - sysop -c "/usr/bin/perl -w /spider/perl/cluster.pl" >
> /dev/tty7 &
>
>
>
> 73 Bastien
>
> PS: Here is the script
>
> #!/bin/bash
> #cfg
> RMTWPX=http://www.country-files.com/cty/wpxloc.raw
> RMTCTY=http://www.country-files.com/cty/cty.dat
> FILECTY=/home/sysop/sources/data_files/cty.dat
> FILEWPX=/home/sysop/sources/data_files/wpxloc.raw
> SPFILECTY=/spider/data/cty.dat
> SPFILEWPX=/spider/data/wpxloc.raw
> CURRDATE=$(date -I);
> #download and diff if new :
> #clean old tmp files :
> rm -f $FILECTY
> rm -f $FILEWPX
> #download online files :
> echo "$CURRDATE - INFO download files : $RMTCTY and $RMTWPX";
> wget $RMTCTY -O $FILECTY &>/dev/null
> if [ $? -ne 0 ]
> then
>          echo "$CURRDATE - ERROR file not found : $RMTCTY";
>          exit 0;
> fi
> wget $RMTWPX -O $FILEWPX &>/dev/null
> if [ $? -ne 0 ]
> then
>      echo "$CURRDATE - ERROR file not found : $RMTWPX";
>          exit 0;
> fi
> #now check if new update is needed :
> MOD=0;
> diff $FILECTY $SPFILECTY &>/dev/null
> if [ $? -ne 0 ]
> then
>      echo "$CURRDATE - INFO new version of $SPFILECTY exist!"
>      MOD=1;
> fi
> diff $FILEWPX $SPFILEWPX &>/dev/null
> if [ $? -ne 0 ]
> then
>      echo "$CURRDATE - INFO new version of $SPFILEWPX exist!"
>          MOD=1;
> fi
> #if needed update prefix file :
> if [ $MOD -eq 1 ]
> then
>          cp $FILECTY $SPFILECTY
>          cp $FILEWPX $SPFILEWPX
>          echo "$CURRDATE - INFO -> launch dxspider prefix update ... ";
>          /spider/perl/create_prefix.pl
>          #restart dxspider :
>          PID=$(cat /spider/local/cluster.lck);
>          kill -KILL $PID;
>          rm -f /spider/local/cluster.lck
>          /bin/su - sysop -c "/usr/bin/perl -w /spider/perl/cluster.pl" >
> /dev/tty7 &
>          echo -e "$CURRDATE - INFO -> restart dxspider."
> else
>          echo -e "$CURRDATE - INFO -> dxspider prefix data is up2date!";
> fi
>
> _______________________________________________
> Dxspider-support mailing list
> Dxspider-support at tobit.co.uk
> https://mailman.tobit.co.uk/mailman/listinfo/dxspider-support
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.tobit.co.uk/pipermail/dxspider-support/attachments/20200122/4fe46775/attachment.htm>


More information about the Dxspider-support mailing list