LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > DamnSmallLinux
User Name
Password
DamnSmallLinux This forum is for the discussion of DamnSmallLinux.

Notices


Reply
  Search this Thread
Old 12-06-2008, 08:21 PM   #1
htrboy
LQ Newbie
 
Registered: Sep 2007
Posts: 8

Rep: Reputation: 0
Problem with MyCron/crontab


Hello,

I'm trying to use cron(MyCron) in DSL, I think the version is 2.4.31. Here is a copy of my crontab:

(I've been commenting stuff out while troubleshooting)

#* * * * * * echo Cron timestamp `date` >> /tmp/crontest
#
#
# Check Photo folder every 5 min
/5 * * * * * /home/dsl/frame/checkdir.sh

# Sync with USB stick if inserted
0 /4 * * * * /home/dsl/frame/rsync.sh

# Restart Frame every morning at 5:30
# to include any new photos in rotation
30 5 * * * * /home/dsl/frame/cron_reload_frame.sh

45 22 * * 1-7 * /home/dsl/frame/turn_off_screen.sh
#15 0 * * 0,6 * /home/dsl/frame/turn_off_screen.sh
59 5 * * 1-7 * /home/dsl/frame/turn_on_screen.sh
#30 7 * * 1-5 * /home/dsl/frame/turn_off_screen.sh
#59 15 * * 0-7 * /home/dsl/frame/turn_on_screen.sh
#59 7 * * 0,6 8 /home/dsl/frame/turn_on_screen.sh

When I start cron this is what I get:

root@4[root]# MyCron &
[1] 19594
root@4[root]# Use of uninitialized value in string at /usr/local/bin/MyCron line 147, <CT> line 6.
Use of uninitialized value in string at /usr/local/bin/MyCron line 147, <CT> line 6.
Use of uninitialized value in string at /usr/local/bin/MyCron line 148, <CT> line 6.
Use of uninitialized value in string at /usr/local/bin/MyCron line 148, <CT> line 6.
Use of uninitialized value in string at /usr/local/bin/MyCron line 148, <CT> line 6.
Argument "SHELL=" isn't numeric in sprintf at /usr/local/bin/MyCron line 73, <CT> line 6.
Argument "bin" isn't numeric in sprintf at /usr/local/bin/MyCron line 73, <CT> line 6.

At first I thought it was the crontab file, but now I don't think so, the error always points to the same lines no matter how the crontab file changes. I've been looking at the MyCron Perl script, but I doubt that's the problem. Can anyone give me some hints?

Thanks in advance!

<<edit>>
forgot to mention - it does the same thing as root or as user - don't know if that matters...

Last edited by htrboy; 12-06-2008 at 08:49 PM. Reason: add information
 
Old 12-08-2008, 10:40 AM   #2
htrboy
LQ Newbie
 
Registered: Sep 2007
Posts: 8

Original Poster
Rep: Reputation: 0
need leading digit

Hi - having to figure out the problem on my own was a great opportunity to learn something, so, um, thanks for that...

anyhoo - In the event that this might help someone else; after diving into the perl code 'MyCron', I figured out that in the time fields of the crontab file there needs to be a leading numerical digit in the fields that contain a non-numerical character. So in my case the line that had a /5 (for instance) needed to be 0/5.

Oh and my other problem was that I was editing the wrong crontab file (ha ha...erm), turns out there was another one in a different location.

Fixed those two things and I'm good to go...
 
Old 12-10-2008, 02:07 AM   #3
JZL240I-U
Senior Member
 
Registered: Apr 2003
Location: Germany
Distribution: openSuSE Tumbleweed-KDE, Mint 21, MX-21, Manjaro
Posts: 4,629

Rep: Reputation: Disabled
Quote:
Originally Posted by htrboy View Post
Hi - having to figure out the problem on my own was a great opportunity to learn something, so, um, thanks for that...
You're welcome .

No, really, I had looked at your first post but had no solution. As an aside, I use fcron: http://fcron.free.fr/. Did you ever look at that?

Last edited by JZL240I-U; 12-11-2008 at 07:46 AM.
 
Old 01-06-2009, 07:51 PM   #4
roystonlodge
Member
 
Registered: Jun 2008
Posts: 161

Rep: Reputation: 32
I know this is an old thread, but if you're still out there, which crontab had to be edited? I've found a crontab in /etc and another one in /opt. Which one is it?
 
Old 01-07-2009, 01:47 AM   #5
JZL240I-U
Senior Member
 
Registered: Apr 2003
Location: Germany
Distribution: openSuSE Tumbleweed-KDE, Mint 21, MX-21, Manjaro
Posts: 4,629

Rep: Reputation: Disabled
Hmm. They are usually for different users (i.e. "root", "somebody-else", etc). You can edit them with
Code:
crontab -u specify-user-here -e
Crontab will select the appropriate file.
Code:
man crontab
man cron
 
Old 01-12-2009, 02:59 PM   #6
roystonlodge
Member
 
Registered: Jun 2008
Posts: 161

Rep: Reputation: 32
I discovered that the crontab in /opt is actually just a symbolic link to the one in /etc. Either one will work.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
crontab problem almon Linux - Newbie 1 10-11-2007 02:27 PM
Crontab problem shafey Red Hat 4 10-31-2006 12:09 AM
Problem using crontab simenzo Linux - Newbie 4 06-07-2006 03:21 PM
crontab problem sunnyanthony Linux - Software 1 01-07-2006 04:48 AM
crontab problem provo1234 Linux - General 3 01-21-2005 11:20 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > DamnSmallLinux

All times are GMT -5. The time now is 01:44 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration