public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* RE: Cron Won't Run Jobs
@ 2002-12-05  6:29 Vince Hoffman
  2002-12-05  6:39 ` Buck Turgidson
  0 siblings, 1 reply; 7+ messages in thread
From: Vince Hoffman @ 2002-12-05  6:29 UTC (permalink / raw)
  To: 'Buck Turgidson', cygwin

Moer info would be good. (cygcheck as an attachment is always a good start
:) 
does monsql pop up a window ? (services that interact with the desktop need
spacial permission) 
try adding a line like 
* * * * * /usr/bin/touch /tmp/crond_running
to your crontab and see if that works,

> -----Original Message-----
> From: Buck Turgidson [mailto:jc_va@hotmail.com]
> Sent: 05 December 2002 13:51
> To: cygwin@cygwin.com
> Subject: Cron Won't Run Jobs
> 
> 
> I installed CYGWIN yesterday, and am having trouble getting 
> cron to work.
> My cron job, set to run every minute, does not execute.
> 
> I have read through the archives, and below is relevant data.
> 
> I would appreciate any advice on what to try next
> 
> 
> chmod 1777 /var/cron
> chmod 1777 /var/cron/tabs
> 
> cygrunsrv -E cron
> cygrunsrv -R cron
> cygrunsrv -I cron -p /usr/sbin/cron -a -D -e "CYGWIN=tty ntsec"
> cygrunsrv -S cron
> 
> 
> This is what the process list looks like:
> 
> /var/cron > ps -ef
>      UID     PID    PPID TTY     STIME COMMAND
>   buck       395       1 con  08:36:06 /usr/bin/bash
>   SYSTEM     392       1   ?  08:40:54 /usr/bin/cygrunsrv
>   SYSTEM     350     392   ?  08:40:54 /usr/sbin/cron
>   buck        63     395 con  08:48:11 /usr/bin/ps
> 
> 
> This is /etc/group
> 
> /var/cron > cat /etc/group
> SYSTEM:S-1-5-18:18:
> None:S-1-5-21-926890155-1422859606-844764980-513:513:
> Administrators:S-1-5-32-544:544:
> Backup Operators:S-1-5-32-551:551:
> Guests:S-1-5-32-546:546:
> Power Users:S-1-5-32-547:547:
> Replicator:S-1-5-32-552:552:
> Users:S-1-5-32-545:545:
> /var/cron >
> 
> 
> 
> This is my cronjob
> 
> /var/cron > crontab -l
> # DO NOT EDIT THIS FILE - edit the master and reinstall.
> # (/tmp/crontab.312 installed on Thu Dec  5 08:39:21 2002)
> # (Cron version -- $Id: crontab.c,v 1.6 2001/09/19 17:09:55 
> corinna Exp $)
> */1 * * * *  monsql
> /var/cron >
> 
> 
> 
> 
> --
> Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
> Bug reporting:         http://cygwin.com/bugs.html
> Documentation:         http://cygwin.com/docs.html
> FAQ:                   http://cygwin.com/faq/
> 

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 7+ messages in thread
* RE: Cron Won't Run Jobs
@ 2002-12-06 17:00 Harig, Mark A.
  0 siblings, 0 replies; 7+ messages in thread
From: Harig, Mark A. @ 2002-12-06 17:00 UTC (permalink / raw)
  To: Buck Turgidson, Eric De La Cruz Lugo, cygwin

[-- Attachment #1: Type: text/plain, Size: 304 bytes --]

Please try running the attached file (a bash shell script).
It attempts to diagnose problems in your directories and
crontab files.  It does *not* change any files, but tells
the user of any problems that it finds.  If it proves to
be useful, it could be donated to the Cygwin 'cron'
distribution.

[-- Attachment #2: cron_diagnose.sh --]
[-- Type: application/octet-stream, Size: 3602 bytes --]

#!/bin/bash
# ======================================================================
# $Source: $
# $Revision: $
# $Name: $
# $Date: $
# $State: $
# $Author: $
# ======================================================================

check_program()
{
	if [ `type $1 > /dev/null 2>&1` ]; then
		echo "The '$1' program is missing or not in your PATH."
		echo "This program is included in the '$2' package."
		echo "Please install this program and run this script again."
		return 1
	fi

	return 0
}

sanity_check()
{
	# Check for programs that this script uses.
	check_program ls fileutils || return 1
	check_program egrep grep || return 1
	check_program id sh-utils || return 1
	check_program cut textutils || return 1
	return 0
}

check_dir()
{
	if [ ! -d $1 ]; then
		echo "Your computer does not appear to have a $1 directory."
		echo "Please investigate this problem, and run this script again."
		return 1
	fi

	if [ `ls -ld $1 | egrep -q 'drwxrwxrxt'` ]; then
		echo "The permissions on the directory $1 are not correct."
		echo "Please run 'chmod 1777 $1', and run this script again."
		return 1
	fi

	return 0
}

check_cron_table()
{
	local user_id=$(id -un)
	local cron_table=/var/cron/tabs/$user_id

	if [ ! -f $cron_table ]; then
		echo "Your computer does not appear to have a crontab for $user_id."
		echo "Please generate a crontab for $user_id using 'crontab -e',"
		echo "and run this script again."
		return 1
	fi

	if [ `ls -l $cron_table|egrep -q 'rw-r-----'` ]; then
		echo "The permissions of your crontab file are set to:"
		ls -l $cron_table
		echo "They need to be set to read/write for $user_id and"
		echo "to read-only for group.  You can set these with"
		echo "	chmod 640 $cron_table"
		echo "Please check your crontab's permissions, and run"
		echo "this script again."
		return 1
	fi

	if [ `ls -l $cron_table|cut -d" " -f8|egrep -q SYSTEM` ]; then
		echo "The group membership of your crontab file should be SYSTEM,"
		echo "as documented in the file /usr/doc/Cygwin/cron.README."
		echo "You can change this setting with:"
		echo "	 chgrp SYSTEM $cron_table"
		echo "Please check your crontab's group membership, and"
		echo "run this script again."
		return 1
	fi

	if [ `ls -ln $cron_table|cut -d" " -f8|egrep -q 18` ]; then
		echo "The value of SYSTEM in your /etc/group file needs to"
		echo "be the reserved number '18', as documented in"
		echo "/usr/doc/Cygwin/cron.README.  Please investigate this"
		echo "and run this script again."
		return 1
	fi

	echo "No errors were found in your crontab setup by this script."
	echo "If you are still unable to get cron to work properly, then"
	echo "try shutting down the cron service, uninstalling it,"
	echo "reinstalling it, and restarting it."
	echo 
	echo "If you are still unable to get cron to run your crontab,"
	echo "then report your problem to cygwin@cygwin.com"
	echo "Please include a copy of your crontab ('crontab -l') and"
	echo "the output of 'cygcheck -srv > cygcheck.txt'.  cygcheck.txt"
	echo "should be included *as an attachment*, not in the body of"
	echo "mail message."

	return 0
}

main()
{
	sanity_check || return 1

	if [ ! -d /var ]; then
		echo "Your computer does not appear to have a /var directory."
		echo "Please investigate this problem, and run this script again."
		return 1
	fi

	check_dir /var/cron || return 1
	check_dir /var/cron/tabs || return 1
	check_cron_table || return 1

	return 0
}

# Entry point:
main
exit $?

# === End of $RCSfile$ === #

[-- Attachment #3: Type: text/plain, Size: 214 bytes --]

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 7+ messages in thread
* RE: Cron Won't Run Jobs
@ 2002-12-06 10:55 Harig, Mark A.
  0 siblings, 0 replies; 7+ messages in thread
From: Harig, Mark A. @ 2002-12-06 10:55 UTC (permalink / raw)
  To: Buck Turgidson, cygwin

> 
> I am not sure how to interpret this, but if you can tell me 
> what I need to
> change, I'd appreciate it.  This is getting me pretty frustrated...
> 
> -rw-r-----    1 400      18            211 Dec  5 08:39 
> /var/cron/tabs/buck
> 
> 

The '18' in your output is the group ownership number.  As documented
in /usr/doc/Cygwin/cron.README, this needs to be set to '18' (which
should be the group number of SYSTEM in /etc/group).  Your crontab's 
permissions and ownerships are set correctly.

Try using a simpler crontab entry, for example:

* * * * * /usr/bin/date >> /tmp/date.txt

Delete all other lines in your crontab until you can get this entry
to work.

Make sure that cron has 'write' permission in /tmp, for example:

   chmod 777 /tmp


---

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 7+ messages in thread
* RE: Cron Won't Run Jobs
@ 2002-12-06  8:21 Harig, Mark A.
  2002-12-06 10:19 ` Buck Turgidson
  0 siblings, 1 reply; 7+ messages in thread
From: Harig, Mark A. @ 2002-12-06  8:21 UTC (permalink / raw)
  To: Buck Turgidson, cygwin

What is the output of 'ls -ln /var/cron/tab/buck'?

'buck' needs to have its 'group' ownership set to SYSTEM,
and SYSTEM needs to have its value set to 18.

> -----Original Message-----
> From: Buck Turgidson [mailto:jc_va@hotmail.com]
> Sent: Thursday, December 05, 2002 9:34 AM
> To: cygwin@cygwin.com
> Subject: Re: Cron Won't Run Jobs
> 
> 
> I have the following line in monsql, and I don't see it, 
> unless I run it
> manually:
> 
> echo "Monsql executed on $(date)" >> /tmp/cron.log
> 
> Here is the output from cygcheck -sv
> 
> 
> 
> 
> 
> ----- Original Message -----
> From: "Vince Hoffman" <Vince.Hoffman@uk.circle.com>
> To: "'Buck Turgidson'" <jc_va@hotmail.com>; <cygwin@cygwin.com>
> Sent: Thursday, December 05, 2002 9:05 AM
> Subject: RE: Cron Won't Run Jobs
> 
> 
> > Moer info would be good. (cygcheck as an attachment is 
> always a good start
> > :)
> > does monsql pop up a window ? (services that interact with 
> the desktop
> need
> > spacial permission)
> > try adding a line like
> > * * * * * /usr/bin/touch /tmp/crond_running
> > to your crontab and see if that works,
> >
> > > -----Original Message-----
> > > From: Buck Turgidson [mailto:jc_va@hotmail.com]
> > > Sent: 05 December 2002 13:51
> > > To: cygwin@cygwin.com
> > > Subject: Cron Won't Run Jobs
> > >
> > >
> > > I installed CYGWIN yesterday, and am having trouble getting
> > > cron to work.
> > > My cron job, set to run every minute, does not execute.
> > >
> > > I have read through the archives, and below is relevant data.
> > >
> > > I would appreciate any advice on what to try next
> > >
> > >
> > > chmod 1777 /var/cron
> > > chmod 1777 /var/cron/tabs
> > >
> > > cygrunsrv -E cron
> > > cygrunsrv -R cron
> > > cygrunsrv -I cron -p /usr/sbin/cron -a -D -e "CYGWIN=tty ntsec"
> > > cygrunsrv -S cron
> > >
> > >
> > > This is what the process list looks like:
> > >
> > > /var/cron > ps -ef
> > >      UID     PID    PPID TTY     STIME COMMAND
> > >   buck       395       1 con  08:36:06 /usr/bin/bash
> > >   SYSTEM     392       1   ?  08:40:54 /usr/bin/cygrunsrv
> > >   SYSTEM     350     392   ?  08:40:54 /usr/sbin/cron
> > >   buck        63     395 con  08:48:11 /usr/bin/ps
> > >
> > >
> > > This is /etc/group
> > >
> > > /var/cron > cat /etc/group
> > > SYSTEM:S-1-5-18:18:
> > > None:S-1-5-21-926890155-1422859606-844764980-513:513:
> > > Administrators:S-1-5-32-544:544:
> > > Backup Operators:S-1-5-32-551:551:
> > > Guests:S-1-5-32-546:546:
> > > Power Users:S-1-5-32-547:547:
> > > Replicator:S-1-5-32-552:552:
> > > Users:S-1-5-32-545:545:
> > > /var/cron >
> > >
> > >
> > >
> > > This is my cronjob
> > >
> > > /var/cron > crontab -l
> > > # DO NOT EDIT THIS FILE - edit the master and reinstall.
> > > # (/tmp/crontab.312 installed on Thu Dec  5 08:39:21 2002)
> > > # (Cron version -- $Id: crontab.c,v 1.6 2001/09/19 17:09:55
> > > corinna Exp $)
> > > */1 * * * *  monsql
> > > /var/cron >
> > >
> > >
> > >
> > >
> > > --
> > > Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
> > > Bug reporting:         http://cygwin.com/bugs.html
> > > Documentation:         http://cygwin.com/docs.html
> > > FAQ:                   http://cygwin.com/faq/
> > >
> >
> > --
> > Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
> > Bug reporting:         http://cygwin.com/bugs.html
> > Documentation:         http://cygwin.com/docs.html
> > FAQ:                   http://cygwin.com/faq/
> >
> 

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 7+ messages in thread
* Cron Won't Run Jobs
@ 2002-12-05  6:01 Buck Turgidson
  0 siblings, 0 replies; 7+ messages in thread
From: Buck Turgidson @ 2002-12-05  6:01 UTC (permalink / raw)
  To: cygwin

I installed CYGWIN yesterday, and am having trouble getting cron to work.
My cron job, set to run every minute, does not execute.

I have read through the archives, and below is relevant data.

I would appreciate any advice on what to try next


chmod 1777 /var/cron
chmod 1777 /var/cron/tabs

cygrunsrv -E cron
cygrunsrv -R cron
cygrunsrv -I cron -p /usr/sbin/cron -a -D -e "CYGWIN=tty ntsec"
cygrunsrv -S cron


This is what the process list looks like:

/var/cron > ps -ef
     UID     PID    PPID TTY     STIME COMMAND
  buck       395       1 con  08:36:06 /usr/bin/bash
  SYSTEM     392       1   ?  08:40:54 /usr/bin/cygrunsrv
  SYSTEM     350     392   ?  08:40:54 /usr/sbin/cron
  buck        63     395 con  08:48:11 /usr/bin/ps


This is /etc/group

/var/cron > cat /etc/group
SYSTEM:S-1-5-18:18:
None:S-1-5-21-926890155-1422859606-844764980-513:513:
Administrators:S-1-5-32-544:544:
Backup Operators:S-1-5-32-551:551:
Guests:S-1-5-32-546:546:
Power Users:S-1-5-32-547:547:
Replicator:S-1-5-32-552:552:
Users:S-1-5-32-545:545:
/var/cron >



This is my cronjob

/var/cron > crontab -l
# DO NOT EDIT THIS FILE - edit the master and reinstall.
# (/tmp/crontab.312 installed on Thu Dec  5 08:39:21 2002)
# (Cron version -- $Id: crontab.c,v 1.6 2001/09/19 17:09:55 corinna Exp $)
*/1 * * * *  monsql
/var/cron >




--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2002-12-07  0:33 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-12-05  6:29 Cron Won't Run Jobs Vince Hoffman
2002-12-05  6:39 ` Buck Turgidson
  -- strict thread matches above, loose matches on Subject: below --
2002-12-06 17:00 Harig, Mark A.
2002-12-06 10:55 Harig, Mark A.
2002-12-06  8:21 Harig, Mark A.
2002-12-06 10:19 ` Buck Turgidson
2002-12-05  6:01 Buck Turgidson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).