Mail Archives: cygwin/2007/08/09/04:21:53
Hi Pierre,
Thanks a ton!!! IT'S WORKING. I did the following and it started to work.
$ cron-config
Cron is already installed as a service under account .\test.
Do you want to remove or reinstall it? (yes/no) yes OK. The cron service was
removed.
Do you want to install the cron daemon as a service? (yes/no) service Do you
want to install the cron daemon as a service? (yes/no) yes Enter the value
of CYGWIN for the daemon: [ntsec smbntsec] ntsec
The service can run either as yourself or under a privileged account.
Running as yourself allows better access to network drives, but does not
allow to run the crontab of other users.
On Windows2003 the SYSTEM account cannot setuid to other users.
You need to have or to create a privileged account.
This script will help you do so.
Do you want to the cron daemon to run as yourself? (yes/no) no
The following accounts were found: 'sshd_server' .
This script plans to use sshd_server.
The user will only be able to run as a service.
Do you want to use another name? (yes/no) no
Please enter the password for user 'sshd_server': test
Reenter: test
Running cron_diagnose ...
WARNING: Your computer does not appear to have a cron table for test.
Please generate a cron table for test using 'crontab -e'
... no problem found.
INFO: A cron daemon is already running.
In case of problem, examine the log file for cron, /var/log/cron.log, and
the Windows event log (using /usr/bin/cronevents) for information about the
problem cron is having.
If you cannot fix the problem, then report it to cygwin AT cygwin DOT com.
Please run the script /usr/bin/cronbug and ATTACH its output (the file
cronbug.txt) to your e-mail.
=============================================
I tried with the following cron jobs and its working fine.
$ crontab -e
* * * * * date > /home/test/date.txt
$ crontab -e
* * * * * /home/test/temp.sh
Temp.sh contains:
#!/bin/bash
LOGNAME=test
SHELL=/bin/bash
PATH=/bin:/etc:/usr/sbin
echo `date` > /home/test/temp.log
touch mytest.txt
Thank you so much.
Thanks
Shashi
Pierre A. Humblet wrote:
>
>
> ----- Original Message -----
> From: "Kiran, Shashi" <Shashi.Kiran>
> To: <cygwin>
> Sent: Wednesday, August 08, 2007 10:40 AM
> Subject: cron
>
>
> Hi,
>
> I 'm trying to schedule a shell script on cygwin using cron. No matter
> what
> I do I don't seem to get the cron job executing my bash script.
>
> My script is temp.sh
>
> echo `date` > /home/test/temp.log
>
> crontab -e is having the following details
>
> * * * * * sh /home/test/temp.sh > /home/test/temp.sh.err 2>&1
>
> I did use the paths in the script itself and I also used the windows
> path
> where the cygwin installed(/cygdrive/d/cygwin/).
>
> I also tried using the following by editing the crontab:
>
> * * * * * date > /home/test/date.txt
>
> Still not working. I don't have administrator login. I ran the
> cron_diagnose.sh and it din't give me any errors.
>
> Please find the attached cronbug.txt
>
> *********
> 1- cronbug shows that the cron daemon is running fine as yourself
> ("test").
> 2- You are in the Administrators group.
> 3- You are running interactively in Terminal Service session on a Windows
> 2003 Server.
> I have never tested that setup, but I see that you have sshd and exim
> (which is stopped)
> under privileged accounts. Any problem there?
> 4- Your crontab file has a PATH that does not include the Windows
> directory,
> which may cause problems (not sure). Removing that line can't hurt.
> 5- There are no cron entries in the Windows event log. This is strange.
> Can you verify
> that fact by looking the Windows application event log yourself?
> 6- /usr/sbin/sendmail is linked to exim.
> Are there any messages in /var/spool/mail/test or any entries is
> /var/log/exim/exim_main.log ?
>
> So the only strange things are 5 and (presumably) that there is no
> /home/test/date.txt
> Please look at 6 and 5 for clues and try 4 .
>
> If the sshd server works fine, try to rerun cron-config to not run cron as
> yourself. It should
> then setup cron to run under the sshd_server account.
> Let us know...
>
> Pierre
>
>
>
> --
> 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/
>
>
>
--
View this message in context: http://www.nabble.com/cron-tf4236852.html#a12068370
Sent from the Cygwin Users mailing list archive 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 -