[Dxspider-support] Prefix data update automation.

Bastien F4EYQ f4eyq at crx.cloud
Thu Jan 23 10:42:39 CET 2020


Le 2020-01-22 19:54, Joaquin . via Dxspider-support a écrit :
> 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 [3] 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 [4] -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
> [2]")
> 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 [1]" >
>> /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 [2]
>> #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 [1]" >
>> /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
> 
> 
> Links:
> ------
> [1] http://cluster.pl
> [2] http://create_prefix.pl
> [3] http://create_usdb.pl
> [4] http://convkeps.pl
> _______________________________________________
> Dxspider-support mailing list
> Dxspider-support at tobit.co.uk
> https://mailman.tobit.co.uk/mailman/listinfo/dxspider-support

Hi Kin,everybody !

Tnx for feedback, i've add usdb into my script,

But i 've a problem database wont load :

root at crx-dxspiderham scripts # /spider/perl/create_usdb.pl 
/spider/data/usdbraw.gz

1423574 records
root at crx-dxspiderham scripts # date
Thu Jan 23 10:41:46 CET 2020
root at crx-dxspiderham scripts # ls -ltra /spider/data/ | grep usdb
-rw-r--r--  1 root  spider  8882968 Jan 23 10:38 usdbraw.gz
-rw-r--r--  1 root  spider 65306624 Jan 23 10:41 usdb.v1
root at crx-dxspiderham scripts #

I've this error :

F4EYQ-1>
load/usdb

US Database not loaded


Do you have an idea ?



73 Regards,
Bastien













---
  WEB:https://bastien.barbe.pw/
GSM:+330637471926|SKYPE:f4eyq_in87is_bzh
QRG:3693|7093|14193|27315|28493|145500|430050-F5ZEM



More information about the Dxspider-support mailing list