delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2006/09/01/06:36:24

X-Spam-Check-By: sourceware.org
Message-ID: <6096299.post@talk.nabble.com>
Date: Fri, 1 Sep 2006 03:36:12 -0700 (PDT)
From: Todde <todde DOT h AT web DOT de>
To: cygwin AT cygwin DOT com
Subject: cron job don't work correct
MIME-Version: 1.0
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

Hi All,

With cygwin i want run a daily script that should build my source every day.
I want do that with a cron job.
On my system the cron service is running.In win xp i am log in as a
domain-user with administrator rights (member in the administrator group).
In cygwin i am log in as a domain-user with administrator rights. So i'm
also included in the administrator group id 544 under cygwin. My crontab
file C:\Programme\cygwin\var\cron\tabs\todde is a member in the
administrator group. My script that i want to start with a cron job script
is located in /home/todde/checkout.sh. This file is also a member in the
administrator group.

One examle:
Basicly i can say the cron job works !
Here is a  simple script that cron job works.

Here is my Crontab:
*/1 * * * * /home/todde/cronscript.sh

Example cronscript.sh:
--------------------------------------------------------------------------------------
#!/bin/bash

touch mytest.txt

------------------------------------------------------------------------------------

Every minute i get a file called mytest.txt. So far so good.

Here is the problem:
But i.e. if i call another script from the cronscript.sh it don't work as a
cronjob but it work when i enter it on the command line.

cronscript.sh:
--------------------------------------------------------------------------------------
#!/bin/bash

check.sh

------------------------------------------------------------------------------------

check.sh:
--------------------------------------------------------------------------------------
#!/bin/bash

touch hello.txt

------------------------------------------------------------------------------------
Or another example:

Example cronscript.sh:
-----------------------------------------------------------------------------------------------------
#!/bin/bash

touch /home/mytest.txt 

------------------------------------------------------------------------------------------------------
This example don't work with cronjob but work from the command line !!!!.
Ok. I know on a real Linux system that don't work regarding write
permissions. But under cygwin it should work!!

Last example that work on command line but not with cronjob:

------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

#!/bin/bash

export CVSDIR=c:
cd $CVSDIR
export BUILD1=s
export BUILD2=e

export CVSROOT=:pserver:user:password AT 99 DOT 99 DOT 99 DOT 9:/local/cvsrepository
cvs login

cvs -q -z3 update -d -P -r BRANCH_TEST source

cvs logout 

--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

All scripts has the user flags rwx. (chmod u+rwx)

Any ideas why the behaviour is so different between command line and cron
job ?? 

Thanks for answers.

Todde

-- 
View this message in context: http://www.nabble.com/cron-job-don%27t-work-correct-tf2201821.html#a6096299
Sent from the Cygwin Users forum at Nabble.com.


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019