You are here

Auto run bash and zip xml to gzp

11 posts / 0 new
Last post
bilo331
Offline
Joined: 7 years
Last seen: 7 years
Auto run bash and zip xml to gzp

i have the new version WebGrab+ V2 installed in linux server (ubuntu) i configured the WebGrab++.config.xml and i got out file xml in the path where i want i will need to run this script by cronjob and gzip the file

currently i have the path for xml in /var/www/EPG/FullUK.xml i tried to run script to get xml file into a gzip file in my path but is not working

i tested with this 2 scripts

#!/bin/bash

cd /root/.wg++/bin

mono WebGrab+Plus.exe "/root/.wg++/bin" 
gzip -cf FullUK.xml > FullUK.xml.gz

exit

 

AND

 

#!/bin/bash

cd /root/.wg++/

mono WebGrab+Plus.exe "/root/.wg++/" 
gzip -cf FullUK.xml > FullUK.xml.gz

exit

when i run the script manually i got this error

root@dide4875:~# ./.wg++/updateUK.sh
-bash: ./.wg++/updateUK.sh: /bin/bash^M: bad interpreter: No such file or directory
root@dide4875:~#

 

May i have some help

 

Thank you

 

bilo331
Offline
Joined: 7 years
Last seen: 7 years

Hi

 

thanks for your help

 

i formated file to unix and run the script got this error

 

[        ] Job started at 31/10/2017 02:10:38
[  Debug ] 
[  Debug ] Running  on: Unix 3.10.107.36
[  Debug ] Environment: 4.0.30319.1
[  Debug ] Mono version: 2.10.8.1 (Debian 2.10.8.1-1ubuntu2.3)
[  Debug ] 
[  Debug ] Loading timezone data
[  Debug ] Embedded timezones source: WGconsole.WG.Common.timezonesdata.txt
[  Debug ] Reading config file: /root/.wg++/bin/WebGrab++.config.xml
[        ] Job finished at 31/10/2017 02:10:38 done in 0s
[Critical] Config syntax exception:
[Critical]       file: /root/.wg++/bin/WebGrab++.config.xml
[Critical]    message: 
[Error   ] WG.Common.InvalidConfigException: [Error   ] Doesn't exist
  at WGconsole.Config..ctor (System.String ConfigurationFilePath) [0x00000] in <filename unknown>:0 
[Critical] For detailed info, see log file /root/.wg++/bin/WebGrab++.log.txt
[Critical] Execution stopped

 

 

Script used

 

#!/bin/bash

cd /root/.wg++/bin/

mono WebGrab+Plus.exe "/root/.wg++/bin/" 
gzip -cf FullUK.xml > FullUK.xml.gz

exit

bilo331
Offline
Joined: 7 years
Last seen: 7 years

Hi

 

attached the file WebGrab++.config.xml it is on path /root/.wg++/

and the file WebGrab+Plus.exe in on path /root/.wg++/bin

the output xml normally should be added in path /var/www/EPG/FullUK.xml 

if i run normal webgrab++ i got th xml file in my path already configured in the file config but with this script not working

 

bilo331
Offline
Joined: 7 years
Last seen: 7 years

Hi

 

Thanks it is working now but after 2 hours grab stopped and got this error

( 159/507 ) UK-SKY.COM -- chan. (xmltv_id=BBC One Yk&Li) -- mode Incremental
iiiiiiinnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn./.wg++/updateUK.sh: line 5: 12524 Killed                  mono WebGrab+Plus.exe "/root/.wg++/"
gzip: FullUK.xml: No such file or directory
You have new mail in /var/mail/root

XML file was added correctly in my path /var/www/EPG/FullUK.xml but in this path /root/.wg++/bin i found a same file gzip but with 0 size and can't open it.

 

i do not know why it is stopped and why gzip file in empty can't even open it with winzip

 

Thank you for your help

bilo331
Offline
Joined: 7 years
Last seen: 7 years

Hi

 

ok i got it now, i started now the script it is working but why after few hours stop grabbing data as i see always when arrive to 105/507 or 115/507 channels

Thanks

bilo331
Offline
Joined: 7 years
Last seen: 7 years

Hi

 

the same issue but the problem that bothers me and I do not understand it is why program stop as you can see 21398 Killed

(  97/507 ) UK-SKY.COM -- chan. (xmltv_id=E4 HD) -- mode Incremental
iiiiiiinnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn./.wg++/updateUK.sh: line 5: 21398 Killed                  mono WebGrab+Plus.exe "/root/.wg++/"
gzip: FullUK.xml: No such file or directory
You have new mail in /var/mail/root
root@asx-7854:~#

mat8861
Offline
WG++ Team memberDonator
Joined: 9 years
Last seen: 20 hours

try 

#!/bin/bash

cd /root/.wg++/bin

mono WebGrab+Plus.exe
cp FullUK.xml /var/www/EPG/FullUK.xml
cd /var/www/EPG/
gzip -cf FullUK.xml

exit 0

Ps 

if the copy does not work try without file name:

cp FullUK.xml /var/www/EPG/

bilo331
Offline
Joined: 7 years
Last seen: 7 years

Hi

 

it's not a problem with gzip but problem is why the program stop because i tested before without script and same issue program stop grabbing data after x hours.

mat8861
Offline
WG++ Team memberDonator
Joined: 9 years
Last seen: 20 hours

do you run " mono WebGrab+Plus.exe "  and it stops ? What log says ?

bilo331
Offline
Joined: 7 years
Last seen: 7 years

Hi

 

Yes it stop after few hours, i am using WebGrab in linux server

log

(  97/507 ) UK-SKY.COM -- chan. (xmltv_id=E4 HD) -- mode Incremental
iiiiiiinnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn./.wg++/updateUK.sh: line 5: 21398 Killed                  mono WebGrab+Plus.exe "/root/.wg++/"
gzip: FullUK.xml: No such file or directory
You have new mail in /var/mail/root
root@asx-7854:~#

 

always program not completd the grabbing

mat8861
Offline
WG++ Team memberDonator
Joined: 9 years
Last seen: 20 hours
bilo331 wrote:

Hi

 

Yes it stop after few hours, i am using WebGrab in linux server

log

(  97/507 ) UK-SKY.COM -- chan. (xmltv_id=E4 HD) -- mode Incremental
iiiiiiinnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn./.wg++/updateUK.sh: line 5: 21398 Killed                  mono WebGrab+Plus.exe "/root/.wg++/"
gzip: FullUK.xml: No such file or directory
You have new mail in /var/mail/root
root@asx-7854:~#

 

always program not completd the grabbing

From what I see you running the script and for some reason it breaks at line 5. I would not use that folder...copy the entire folder in /opt or the home directory of a user , like /home/ubuntu and change to:

#!/bin/bash

cd /home/ubuntu/.wg++/bin

mono WebGrab+Plus.exe
cp FullUK.xml /var/www/EPG/FullUK.xml
cd /var/www/EPG/
gzip -cf FullUK.xml

exit 0

after you save the script, make sure the script has permission 755 and of course the group/owner (chown and chgrp) same as user. Then run the script as a user :

cd /home/ubuntu

./updateUK.sh

finally add to the user crontab (crontab -e) and add the folling line so it runs every midnight:

0 0 * * * /bin/sh /home/ubuntu/.wg++/bin/upgradeUK.sh

 

Log in or register to post comments

Brought to you by Jan van Straaten

Program Development - Jan van Straaten ------- Web design - Francis De Paemeleere
Supported by: servercare.nl