This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

cron job don't work correct


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@99.99.99.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/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]