Hello. I've been reading and tinkering for days but I still can't seem to get this cron job working. It's hopefully a simple fix and I'm just being stupid.
I am trying to use crontab to run a script every 3 hours to download an EPG for TVheadend.
To start, I used "crontab -e" to edit my crontab file. This is the crontab file I started with:
I included an empty line at the end of the file as some posts recommended. I ^o to save the file as "/storage/.cache/cron/crontabs.753" and ^x to exit the editor. Next I run "crontab -l" which returns the file I just wrote.
In my "/storage/" directory I have "epg.sh" which I have made executable with "chmod +x epg.sh" (I have also tried "chmod 775 epg.sh" and "chmod a+x epg.sh").
This is my "epg.sh" file:
This runs perfectly when I do "sh /storage/epg.sh" in console, but it never runs through my crontab command.
I've read a bunch of posts about cron and crontab on libreelec and far too many other linux systems.
Following other's advice, I tried modifying my crontab file to this:
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/storage
0 0,3,6,9,12,15,18,21 * * * /storage/epg.sh
No luck.
I also tried modifying my "epg.sh" to this:
#!/bin/sh
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/storage
wget -O /storage/xmltv.php.xml "<url>"
Again, nothing.
I've run "ps aux | grep cron", "ps aux | grep crond" & "ps aux | grep crontab" which return:
# ps aux | grep cron
619 root 0:00 /sbin/crond -f -S
875 root 0:00 grep cron
# ps aux | grep crond
619 root 0:00 /sbin/crond -f -S
877 root 0:00 grep crond
# ps aux | grep crontab
879 root 0:00 grep crontab
This means they are all running, right? Hopefully they are all stopped and I'm being stupid and someone can tell me how to start them.
I have tried "systemctl restart cron", which executes successfully but makes no difference.
I have tried "/etc/init.d/crond start", "/etc/init.d/crond stop" & "service crond restart" based on random posts regarding other systems, obviously none of these execute.
I even did "crontab -r" and made a brand new file with "crontab -e" again just to make sure I didn't mess something up the first time, but still no luck.
I am at a loss. Does anyone have any sage advice for me? Please?
Thanks in advance.