[질문]cygwin에서 cron을 사용하고 싶습니다.
글쓴이: player02 / 작성시간: 금, 2004/06/04 - 5:31오후
cygwin에서 cron을 사용하고 싶습니다.
아래와 같이 데몬을 띄우고 crontab을 설정했는데
특정시간에 수행이 안되네요.--;
뭐가 잘못되었는지 알려주세요.
고맙습니다.
-아래-
% start_cron.sh
cygrunsrv -E cron
cygrunsrv -R cron
cygrunsrv -I cron -p /usr/sbin/cron -a -D -e "CYGWIN=tty ntsec"
cygrunsrv -S cron
% crontab -e
16 16 * * * /home/test.sh
Forums:
[자답]
자답입니다.
#!/bin/sh
cygrunsrv -E cron
cygrunsrv -R cron
# cygrunsrv -I cron -p /usr/sbin/cron -a -D -e "CYGWIN=tty ntsec" --> 1) 동작안함
cygrunsrv -I cron -d "Cron" -p /usr/sbin/cron -a "-D" -e "CYGWIN=binmode ntsec tty" --> 2) 동작
cygrunsrv -S cron
메일링리스트를 뒤져보니 답이 있더군요.^^ (http://www.cygwin.com/ml/cygwin/2002-04/ )
=================================================================================
Subject: Strange Crond behavior
MIME-Version: 1.0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Date: Mon, 1 Apr 2002 12:47:21 +0200
X-MIMEOLE: Produced By Microsoft Exchange V6.0.5762.3
content-class: urn:content-classes:message
Message-ID: <5606CDAB719FDC40ACEFBCCDE0D9E1B57F9F@mail.jackal-net.at>
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
From: "Michael Lang" <michi@jackal-net.at>
To: <cygwin@cygwin.com>
Hello to all=20
Sorry for bothering but I didn=B4t find an issue for these strange =
behavior of the Crond .
Does someone knows why using cron as service doesn't start any scheduled =
tasks ? Event Error :
Using /usr/sbin/cron -D=20
> seteuid: Not owner
(service installation: cygrunsrv -I cron -d "Cron" -a "-D" -p =
/usr/sbin/cron(|.exe) )
service get=B4s started=20
Event Type: Information
Event Source: cron
Event Category: None
Event ID: 0
Date: 4/1/2002
Time: 12:35:22 PM
User: NT AUTHORITY\SYSTEM
Computer: FLOCKE
Description:
The description for Event ID ( 0 ) in Source ( cron ) cannot be found. =
The local computer may not have the necessary registry information or =
message DLL files to display messages from a remote computer. The =
following information is part of the event: cron : Win32 Process Id =3D =
0x98C : Cygwin Process Id =3D 0x98C : `cron' service started.
=================================================================================
Subject: RE: Strange Crond behavior
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
I believe the root cause is that the CYGWIN environment variable needs
to be set to include NTSEC.
The instructions in /usr/doc/Cygwin/cron.README include this command:
cygrunsrv -I cron -p /usr/sbin/cron -a -D
That will not always work
A command that works better is:
cygrunsrv -I cron -d "Cron" -p /usr/sbin/cron -a "-D" -e "CYGWIN=binmode
ntsec tty"
or, alternatively, you can set the CYGWIN environment variable another way.
================================================================================
댓글 달기