You are here

cronjob

9 posts / 0 new
Last post
jNilsson
Offline
Donator
Joined: 2 years
Last seen: 1 year
cronjob

hi i need a little bit help from jan. support guy tell me that u can help with this.
i want du amke different config files. and start all with cronjob. i look into run.sh but there i dont find line to change source for the configfile.
give another way to make more confg files and run it per cronjob without change evrytime the name from config file to original.?

ejohalj
Offline
Donator
Joined: 6 years
Last seen: 1 month

If you are running on a linux system which I think you are then it is very easy. You set up different folders for your different EPG. Then to start them, you create a python program that looks like this, depending on what you use to start the epg guides:

os.system('mono /the bin folder/WebGrab+Plus.exe /the folder of the EPG')
os.system('/home/pi/.dotnet/dotnet /the bin.net folder/WebGrab+Plus.dll /the folder of the EPG')

You can have as many folders as you want in here.

to run the file, you do:

crontab -e

and add the when and how often it should run. This might be a good site to check how to create with correct time: https://crontab.guru/

so you might have it like:
0 15 * * */3 /usr/bin/python3 /home/pi/Downloads/run_epg.py

Hope this what something like you wanted.

Kiros
Offline
Donator
Joined: 4 years
Last seen: 11 months

sorry that i am falling on your thread i dunno if i should open a new one or ask question here

I am having an issue with the cronjob here
I am using bash to run the software
while using it on mono it works great but when i am setting a bash file for dotnet for some reason
cronjob is skipped
and in syslog i did not find any issue it shows that the bash file was executed but there is no change in the folder
and when i exc the bash manually it does work

00 7 * * 0-6 /var/epg/startd

inside the bash file dotnet

#!/bin/bash
cd /root/.wg++/bin.net
dotnet WebGrab+Plus.dll "/var/epg/grab"

inside the bash file mono

#!/bin/bash
cd /root/.wg++/bin
mono WebGrab+Plus.exe "/var/epg/grab"

so i am kinda lost as to why its skipped while with dotnet

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

if you run
cd /var/epg/
./startd
Does it work ?

Kiros
Offline
Donator
Joined: 4 years
Last seen: 11 months

the /var/epg/startd is a bash file
i don't see a reason to add .sh or w/e

as i stated before this is the commands in the bash file startd

#!/bin/bash
cd /root/.wg++/bin.net
dotnet WebGrab+Plus.dll "/var/epg/grab"

as when the dotnet is used in the startd bash file for some reason the it does not work

Jul 6 07:00:01 localhost CRON[30423]: (root) CMD (/var/epg/startd)

the log shows that the bash file was executed but in the reality there was no change
unless i'll manually execute the bash file and then it start the process

while the bash file had the mono the cronjob started the process of grabbing
i did restarted the cronjob and restarted the server but while the bash has dotnet for some reason the process does not start

mat8861
Offline
WG++ Team memberDonator
Joined: 9 years
Last seen: 10 hours
Kiros
Offline
Donator
Joined: 4 years
Last seen: 11 months

okie i got an output on the bash
/var/epg/startd: line 3: dotnet: command not found

did not found there a solution how to run the dotnet via cronjob ;S

nvm found a solution seems that i have missed up something reinstalled the dotnet and cronjob started to work :D
thanks for all the help xD

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

Just for other user did you reinstall just .net sdk or the .net runtime?

Kiros
Offline
Donator
Joined: 4 years
Last seen: 11 months

the sdk and the runtime
i guess that there was some issue with the repository that contained the dotnet installer

but if someone will have an issue the best way to find whats wrong is to get an output file
to run the cronjob * * * * * /path/to/bashfile

and in the bash file to add
dotnet WebGrab+Plus.dll "/path/to/webgrab-folder" >>/path/to/output/file/output-file-name 2>&1

and from that output file they can find out what is the issue

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