LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices



Reply
 
Search this Thread
Old 09-24-2006, 09:25 PM   #1
wgato
Member
 
Registered: Jun 2006
Distribution: ubuntu slax dsl
Posts: 40

Rep: Reputation: 15
cron problems


anyone have any suggestions?
i'm having a hard time getting cron to work using ubuntu dapper server

i tried using crontab -e as the user wg and adding the line:
* * * * * wg /home/wg/ghostbin/test

where the text of test is:
#!/bin/sh
echo "cron test" >> /home/wg/ghostbin/crontest.txt

didnt work. then i changed to root and did tried the same thing with crontab -e. no good.

i also tried puting test in /etc/cron.hourly, though i'd like more control over when it runs than that. but it didnt work anyway.

i restarted cron. then stopped it & started it again. rebooted the machine.

btw running 'echo "cron test" >> /home/wg/ghostbin/crontest.txt' at the command line does work.

i'm not sure what else to try. any ideas?

Last edited by wgato; 09-24-2006 at 09:26 PM.
 
Old 09-24-2006, 10:45 PM   #2
Berhanie
Senior Member
 
Registered: Dec 2003
Location: phnom penh
Distribution: Fedora
Posts: 1,625

Rep: Reputation: 165Reputation: 165
Make sure crontest.txt has execute permissions?
 
Old 09-24-2006, 11:07 PM   #3
wgato
Member
 
Registered: Jun 2006
Distribution: ubuntu slax dsl
Posts: 40

Original Poster
Rep: Reputation: 15
thanks for the suggestion

none of my other cronjobs are running either, this was just my simple test to try to isolate the problem

but i'll try creating crontest.txt myself and manually setting the permissions.

thanks!
 
Old 09-24-2006, 11:16 PM   #4
Berhanie
Senior Member
 
Registered: Dec 2003
Location: phnom penh
Distribution: Fedora
Posts: 1,625

Rep: Reputation: 165Reputation: 165
The syntax for a user's crontab is:
Code:
* * * * * /home/wg/ghostbin/test
Note that there is no field for the user. That's more likely
the problem. Check the logs.
 
Old 09-24-2006, 11:53 PM   #5
wgato
Member
 
Registered: Jun 2006
Distribution: ubuntu slax dsl
Posts: 40

Original Poster
Rep: Reputation: 15
i tried chmod 777 crontest.txt and removing the username from the the crontab. neither worked.

which logs are you refering to?
 
Old 09-25-2006, 12:00 AM   #6
Berhanie
Senior Member
 
Registered: Dec 2003
Location: phnom penh
Distribution: Fedora
Posts: 1,625

Rep: Reputation: 165Reputation: 165
Quote:
which logs are you refering to?
It may be something like /var/log/cron, but check /etc/syslog.conf if you're not sure. cron should also send you an email whenever there's an error message (but, you need to have configured a mail server for that -- otherwise, the mail just stays in queue).

Sorry: it's /home/wg/ghostbin/test not /home/wg/ghostbin/crontest.txt that should have execute perms.

Last edited by Berhanie; 09-25-2006 at 12:04 AM.
 
Old 09-25-2006, 12:13 AM   #7
wgato
Member
 
Registered: Jun 2006
Distribution: ubuntu slax dsl
Posts: 40

Original Poster
Rep: Reputation: 15
thank you for all your suggestions, i appreciate the time

/home/wg/ghostbin/test has the correct permissions because it runs ok from the command line.

i didnt see /var/log/cron and when i checked /etc/syslog.conf, i found:
#cron.* /var/log/cron.log
daemon.* -/var/log/daemon.log
kern.* -/var/log/kern.log

so cron is commented out and doesnt have - in front of the directory like daemon and kern. weird.
 
Old 09-25-2006, 12:16 AM   #8
Berhanie
Senior Member
 
Registered: Dec 2003
Location: phnom penh
Distribution: Fedora
Posts: 1,625

Rep: Reputation: 165Reputation: 165
Just uncomment it and give syslogd a sighup:
Code:
kill -HUP `cat /var/run/syslogd.pid`

Last edited by Berhanie; 09-25-2006 at 12:23 AM.
 
  


Reply

Tags
cron


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Can any one plz explain why/what for cron.d, cron.daily, cron.weekly etc are there. mavinashbabu Linux - Newbie 4 09-21-2006 02:50 PM
Cron Problems DNAphil Linux - Newbie 1 07-12-2005 08:56 AM
cron problems tassinari Linux - Newbie 8 04-02-2005 11:11 PM
problems using cron Mugatu Linux - Software 3 02-26-2004 03:15 PM
CRON problems jlinden Linux - General 1 09-02-2003 03:16 PM


All times are GMT -5. The time now is 08:11 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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration