[Dxspider-support] Prefix data update automation.

Ioannis Panagou sv5fri at gmail.com
Wed Jan 22 18:43:30 CET 2020


Please you check below example

12. Service Configuration (systemd)

Login as and a basic service file for systemd

create a file

   - # touch /etc/systemd/system/dxspider.service
   -
   -
   - # vi /etc/systemd/system/dxspider.service

With the following contents

   - [Unit]
   - Description= Dxspider DXCluster service
   - After=network.target
   -
   - [Service]
   - Type=simple
   - User=sysop
   - Group=sysop
   - ExecStart= /usr/bin/perl -w /spider/perl/cluster.pl
   - # Comment out line below for logging everything to /var/log/messages
   - StandardOutput=null
   - Restart=always
   -
   - [Install]
   - WantedBy=multi-user.target

Usage:

   - to start up dxspider
   -
   - # systemctl start dxspider
   -
   - to stop
   -
   - # systemctl stop dxspider
   -
   - to set up to start on boot
   -
   - # systemctl enable dxspider


73 de Yiannis, SV5FRI

On Wed, Jan 22, 2020, 19:39 Ioannis Panagou <sv5fri at gmail.com> wrote:

> Hi, you can use systemd
>
> 73 de Yiannis, SV5FRI
>
> On Wed, Jan 22, 2020, 19:26 Bastien F4EYQ via Dxspider-support <
> dxspider-support at tobit.co.uk> wrote:
>
>>
>> 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/c890444b/attachment-0001.htm>


More information about the Dxspider-support mailing list