OMV crontab help

Moderators: odroid, mdrjr

OMV crontab help

Unread postby cadelle » Fri Jun 15, 2018 4:05 am

Totally new to this aspect of Linuxing and so I have some basic questions...

Whenever I work in the CLI I always sign in as root and work that way, is this a problem? Because of this whenever I create a batch file the location ends up being \root\filename.sh - does that cause a problem for crontab? Most post show the location of their scripts as /usr/bin/filename.sh

when I crontab -l I see the lines in the list but they are not working. I attempted to set these up in the GUI using scheduled tasks and while I seemed to be able to execute them properly they aren't working on their own.

I don't know if it makes a difference but I am running the XU4 in a cloudshell2 setup with hardware RAID 0

Thank you
cadelle
 
Posts: 47
Joined: Sat Feb 24, 2018 3:24 am
languages_spoken: english
ODROIDs: XU4, cloudshell2

Re: OMV crontab help

Unread postby tobetter » Fri Jun 15, 2018 11:10 am

What's the last line what you see and you suspect not working? Regardless what's the commands specified in the crontab, its path must match with decent permission. If your crontab shows to execute /usr/bin/filename.sh then your filename.sh must be in /usr/bin instead of /root.
Last edited by tobetter on Fri Jun 15, 2018 12:33 pm, edited 1 time in total.
tobetter
 
Posts: 2183
Joined: Mon Feb 25, 2013 10:55 am
Location: Paju, South Korea
languages_spoken: Korean, English
ODROIDs: X, X2, U2, U3, XU3, C1

Re: OMV crontab help

Unread postby cadelle » Fri Jun 15, 2018 12:26 pm

this is what I've got in my crontab

Code: Select all
0 8 * * * /root/lcd_on.sh
0 22 * * * /root/lcd_off.sh
*/30 * * * /root/checkRAID.bash


and this is my root directory

Code: Select all
root@odroidxu4:~# dir
checkRAID.bash
lcd_off.sh
lcd_on.sh
raidmgr_static


Being that it is located in root and being run by root would that not be enough permission? Is there something I can do to check?
Also, I did verify that when I run them from the terminal they work so I am leaning towards some kind of path or permission issue as well. Any tips on how to troubleshoot would be much obliged.
cadelle
 
Posts: 47
Joined: Sat Feb 24, 2018 3:24 am
languages_spoken: english
ODROIDs: XU4, cloudshell2

Re: OMV crontab help

Unread postby tobetter » Fri Jun 15, 2018 12:46 pm

Maybe you can check the log with the command grep CRON /var/log/syslog. If it shows some logs which calls your script, then CRONTAB itself is triggering the task, but your script might be fixed to be called.

My quick test to call /home/tobetter/run.sh shows this log.
Code: Select all
(root) CMD (/home/tobetter/run.sh)
tobetter
 
Posts: 2183
Joined: Mon Feb 25, 2013 10:55 am
Location: Paju, South Korea
languages_spoken: Korean, English
ODROIDs: X, X2, U2, U3, XU3, C1


Return to Other OS

Who is online

Users browsing this forum: No registered users and 1 guest