Manually scripting crossepg for crontab

Tamaki

Administrator
Next challenge :)
Based on a weekly E2 reboot I'd like to do the same with crossepg, have it run twice a week via crontab (ea: see http://www.vuplus-community.net/board/threads/force-file-swap-reduce-ram.3125/page-2#post-26726)

So the question is, how do you run crossepg from telnet like the download button does ?
(yes I've run it before from telnet but it is not using the config file and starts downloading everything...)
I don't know if it works but try to connect with telnet, then make download epg with RC, and type ps on telnet to see what processes are working, maybe you could find commands.
This is just a try, because i don't know which commands crossepg uses.
 

bh4me2

Vu+ Newbie
Well I got this far:
cronjob
Code:
45 21 * * * /bin/sh /usr/crossepg/mancrossepg.sh
But it does not run..... (* but if I run it in telnet "/bin/sh /usr/crossepg/mancrossepg.sh" it runs ok)

mancrossepg.sh
Code:
/usr/crossepg/crossepg_downloader -l /usr/crossepg -d /media/hdd/crossepg -p xepgdb_rytec_benelux_xmltv__xepgdb_repacked_
/usr/crossepg/crossepg_downloader -l /usr/crossepg -d /media/hdd/crossepg -p xepgdb_rytec_uk_xmltv__xepgdb_repacked_
/usr/crossepg/crossepg_dbconverter
* It runs in telnet all the way but EPG does not get loaded into ram.... load command missing.
 

bh4me2

Vu+ Newbie
Yes or:
/usr/crossepg/crossepg_epgcopy /media/hdd/crossepg/ext.epg.dat /media/hdd/epg.dat
works too, after that e2 initiates the ram load so this completes a full crossepg run.

Currently the problem I'm having is that crontab refuses to run a script with crossepg commands, even a direct crossepg line does not run via crontab (it works all fine in telnet). Somehow the crossepg modules are protected to run from crontab or some startup values crossepg depends on are missing as it all runs perfectly fine in telnet.
 

bh4me2

Vu+ Newbie
Ok, we have liftoff! :)

A nice working workaround, place content in the files 'root' and 'bh.cron' in \etc\bhcron:
Code:
15 5 * * * if [ `/bin/date +%a` != "Sun" ] && [ `/bin/date +%a` != "Wed" ]; then /bin/sed 's/download_daily_enabled=./download_daily_enabled=0/g' /usr/crossepg/crossepg.config > /usr/crossepg/crossepg.config.1;rm /usr/crossepg/crossepg.config;mv /usr/crossepg/crossepg.config.1 /usr/crossepg/crossepg.config; fi
18 5 * * * if [ `/bin/date +%a` = "Sun" ] || [ `/bin/date +%a` = "Wed" ]; then /bin/sed 's/download_daily_enabled=./download_daily_enabled=1/g' /usr/crossepg/crossepg.config > /usr/crossepg/crossepg.config.1;rm /usr/crossepg/crossepg.config;mv /usr/crossepg/crossepg.config.1 /usr/crossepg/crossepg.config; fi
20 5 * * * if [ `/bin/date +%a` = "Sun" ] || [ `/bin/date +%a` = "Wed" ]; then /usr/bin/Blackholecmd restartenigma2; fi
22 5 * * * if [ `/bin/date +%a` = "Sun" ] || [ `/bin/date +%a` = "Wed" ]; then /usr/bin/Blackholecmd standby; fi
Place a file with the name \etc\bhcron\cron.update and only 'root' as its contents to get cron to see it.

Hopefully I got the and/or's in the right order. But no more need to fiddle with crossepg, this will enable/disable the auto update option from crossepg. Do adjust crossepg's update time after the last cronjob.

So now we have:
On Wednesday and Sunday do;
1. enable crossepg update option
2. reboot E2
3. go into standby
4. crossepg will auto update at set time

On any other day do;
1. disable crossepg update option
 

a911

The BH Lover
GooD job BH4me,
Can U make a fix into the orginal plug-ins, and lets test it!
Rgds
a911
 

bh4me2

Vu+ Newbie
Tnx, but this is basically a 'hack' into crossepg's config file. I've looked into crossepg source code but haven't found how it gets started like when you press the menu download button, its a wrapper system calling individual modules while parsing the config file. I did file a rfc to the author about this wanted 'feature'. But for now this works just the same.
 
Top