Cron job help

Victor87

Dabbler
Joined
Aug 28, 2022
Messages
16
Hello all

I try to add an cron job on truenas scale to grab automatic the epg with webgrabplus app installed from truechart.

If I run the command "/defaults/update.sh" in the pod shell of the webgrab app, everything works perfect. It will look like this: "root@webgrabplus-696c8d9dc8-8f7ls:/# /defaults/update.sh".

But on the cron job all the path what I was trying to add it always fail with error "no such file or directory".

How can I find the correct path of the file?

Thanks
 
Joined
Jun 2, 2019
Messages
591
1. Make sure the file has execute permission
Code:
chmod a+x {filename}

2. Prefix the CRON task with
Code:
/bin/sh {path/filename}
 

Victor87

Dabbler
Joined
Aug 28, 2022
Messages
16
1. Make sure the file has execute permission
Code:
chmod a+x {filename}

2. Prefix the CRON task with
Code:
/bin/sh {path/filename}
I'm beginner and I don't understand very well all the stuff
If I run "chmod a+x update.sh" or "chmod a+x defaults/update.sh"on shell it says no such file or directory.
On shell pod it looks like in the picture.

Also on cron job with comand "/bin/sh default/update.sh" it doesn't find the path or directory
 

Attachments

  • IMG_20230220_013634.jpg
    IMG_20230220_013634.jpg
    66.9 KB · Views: 91
Last edited:
Joined
Jun 2, 2019
Messages
591
Joined
Jun 2, 2019
Messages
591
I test with and without. You mean /defaults/update.sh? Doesn't work
I am guessing you don't have the shell shebang in the header of the file.

Code:
#!/bin/sh
 

Victor87

Dabbler
Joined
Aug 28, 2022
Messages
16
I am guessing you don't have the shell shebang in the header of the file.

Code:
#!/bin/sh
Means that the command in Cron job must look like this?
#!/bin/sh /defaults/update.sh

Or you mean on the wg3-cron file from webgrabplus app? Picture attached
 

Attachments

  • Screenshot_20230220_135240_com.byteexperts.texteditor.jpg
    Screenshot_20230220_135240_com.byteexperts.texteditor.jpg
    30.1 KB · Views: 91
Last edited:
Top