Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Portage & Programming
  • Search

scheduled task not running with (vixie)cron

Problems with emerge or ebuilds? Have a basic programming question about C, PHP, Perl, BASH or something else?
Post Reply
Advanced search
4 posts • Page 1 of 1
Author
Message
manouchk
Apprentice
Apprentice
User avatar
Posts: 288
Joined: Mon May 08, 2006 8:27 pm
Location: Vitória (ES), Brasil
Contact:
Contact manouchk
Website

scheduled task not running with (vixie)cron

  • Quote

Post by manouchk » Sat May 17, 2008 7:22 pm

Hi,

I started using cron recently and scheduled tasks were firstly working and now there are simply ignored. THere tasks supposed to run every minutes

Here is some information:

Code: Select all

/etc/init.d/vixie-cron status
 * status:  started
manu asterisk # crontab -l
# DO NOT EDIT THIS FILE - edit the master and reinstall.
# (/tmp/crontab.XXXXQ6UBVw installed on Mon May 12 08:52:10 2008)
# (Cron version V5.0 -- $Id: crontab.c,v 1.12 2004/01/23 18:56:42 vixie Exp $)
# for vixie cron
#
# $Header: /var/cvsroot/gentoo-x86/sys-process/vixie-cron/files/crontab-3.0.1-r4,v 1.1 2005/03/04 23:59:48 ciaranm Exp $
#
#

# Global variables
SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root
HOME=/

# check scripts in cron.hourly, cron.daily, cron.weekly and cron.monthly
0  *  * * *     root    rm -f /var/spool/cron/lastrun/cron.hourly
1  3  * * *     root    rm -f /var/spool/cron/lastrun/cron.daily
15 4  * * 6     root    rm -f /var/spool/cron/lastrun/cron.weekly
30 5  1 * *     root    rm -f /var/spool/cron/lastrun/cron.monthly
*/1 * * * *     root    python /root/ntp.py
*/1 * * * *     root    python /root/sshd.py
*/10  *  * * *  root    test -x /usr/sbin/run-crons && /usr/sbin/run-crons
Top
bunder
Bodhisattva
Bodhisattva
Posts: 5956
Joined: Sat Apr 10, 2004 5:13 am

  • Quote

Post by bunder » Sat May 17, 2008 9:02 pm

anything in the cron logs?
Neddyseagoon wrote:The problem with leaving is that you can only do it once and it reduces your influence.
banned from #gentoo since sept 2017
Top
prizident
n00b
n00b
Posts: 42
Joined: Wed Dec 06, 2006 9:21 pm

  • Quote

Post by prizident » Sat May 17, 2008 9:05 pm

don't forget newline symbol at the end
Top
manouchk
Apprentice
Apprentice
User avatar
Posts: 288
Joined: Mon May 08, 2006 8:27 pm
Location: Vitória (ES), Brasil
Contact:
Contact manouchk
Website

  • Quote

Post by manouchk » Sat May 17, 2008 10:06 pm

I just found some (a lot!) cron log in /var/log/messages

Code: Select all

tail /var/log/messages
May 17 18:57:02 manu cron[9103]: (root) MAIL (mailed 35 bytes of output but got status 0x0001 )
May 17 18:57:47 manu rc-scripts: status:  stopped
May 17 18:58:01 manu cron[9213]: (root) CMD (root    python /root/sshd.py)
May 17 18:58:01 manu cron[9215]: (root) CMD (root    python /root/ntp.py)
May 17 18:58:01 manu sSMTP[9216]: Unable to locate mail
May 17 18:58:01 manu sSMTP[9216]: Cannot open mail:25
May 17 18:58:01 manu cron[9214]: (root) MAIL (mailed 35 bytes of output but got status 0x0001 )
May 17 18:58:01 manu sSMTP[9217]: Unable to locate mail
May 17 18:58:01 manu sSMTP[9217]: Cannot open mail:25
May 17 18:58:01 manu cron[9212]: (root) MAIL (mailed 35 bytes of output but got status 0x0001 )
Is there another place were I can find log?

Basically the script /root/ntp.py just start the ntp-client initscript if it is stopped. I stopped this script and it definitely not start it!

Maybe the script is not working "in" cron?

Code: Select all

# more /root/ntp.py
#!/usr/bin/python
import os
import time
stopped=0
a=os.popen('/etc/init.d/ntp-client status')
for l in a.readlines():
    if l.count('stopped'):
        stopped=1
if stopped:
    os.system('/etc/init.d/ntp-client start')
Top
Post Reply

4 posts • Page 1 of 1

Return to “Portage & Programming”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic