[SOLVED] Crontab problem

This forum is dedicated to basic help and support :

Ask here your questions about basic installation and usage of Mageia. For example you may post here all your questions about getting Mageia isos and installing it, configuring your printer, using your word processor etc.

Try to ask your questions in the right sub-forum with as much details as you can gather. the more precise the question will be, the more likely you are to get a useful answer

[SOLVED] Crontab problem

Postby nightshadow » Jan 20th, '14, 02:20

Hello there,

My entry in crontab won't work at all.
Code: Select all
[nightshadow@localhost ~]$ crontab -l
@reboot /home/nightshadow/conky.sh

But nothing happens when I reboot.Everything works fine if I use time, and not @reboot.
But with @reboot, it just won't work.
File conky.sh exists, and has +x permission.I can run it with ./conky.sh from cli, and it works.
What could be the problem ?

Regards,
Darko.
Last edited by nightshadow on Jan 21st, '14, 16:35, edited 1 time in total.
nightshadow
 
Posts: 38
Joined: Dec 12th, '13, 23:35

Re: Crontab problem

Postby Ken-Bergen » Jan 20th, '14, 03:32

If conditions do not yet exist for what your script does it will fail.
So what does your script do?
Ken
Ken-Bergen
 
Posts: 1019
Joined: Mar 30th, '11, 02:45
Location: Chilliwack, BC, Canada

Re: Crontab problem

Postby ITA84 » Jan 20th, '14, 11:11

The script is located inside your home directory, so maybe Cron tries to run it before /home is mounted (I've read someone had the same problem with an encrypted /home). See if it works when moved somewhere else (say, /usr/local/bin).
ITA84
 
Posts: 199
Joined: Mar 5th, '13, 18:15

Re: Crontab problem

Postby nightshadow » Jan 20th, '14, 17:59

Ken-Bergen wrote:If conditions do not yet exist for what your script does it will fail.
So what does your script do?

Code: Select all
[nightshadow@localhost ~]$ cat /usr/local/bin/conky.sh
#!/bin/bash
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
export DISPLAY=:0.0
/usr/bin/conky
[nightshadow@localhost ~]$



ITA84 wrote:The script is located inside your home directory, so maybe Cron tries to run it before /home is mounted (I've read someone had the same problem with an encrypted /home). See if it works when moved somewhere else (say, /usr/local/bin).

Tried it now, didn't work.
nightshadow
 
Posts: 38
Joined: Dec 12th, '13, 23:35

Re: Crontab problem

Postby doktor5000 » Jan 20th, '14, 21:49

Why not put it into /etc/X11/xinit.d/ as with a cronjob it's probably racy, as you don't check if the X server is already running.
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 18070
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: Crontab problem

Postby nightshadow » Jan 20th, '14, 23:38

That works.Thanks.
nightshadow
 
Posts: 38
Joined: Dec 12th, '13, 23:35

Re: Crontab problem

Postby doktor5000 » Jan 20th, '14, 23:46

Please mark the thread accordingly by editing the topic of the first post and prefix it by [SOLVED], thanks
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 18070
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany


Return to Basic support

Who is online

Users browsing this forum: No registered users and 1 guest