[질문]cygwin에서 cron을 사용하고 싶습니다.

player02의 이미지

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

player02의 이미지

자답입니다.

#!/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.
================================================================================

댓글 달기

Filtered HTML

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

BBCode

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param>
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

Textile

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • You can use Textile markup to format text.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Markdown

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • Quick Tips:
    • Two or more spaces at a line's end = Line break
    • Double returns = Paragraph
    • *Single asterisks* or _single underscores_ = Emphasis
    • **Double** or __double__ = Strong
    • This is [a link](http://the.link.example.com "The optional title text")
    For complete details on the Markdown syntax, see the Markdown documentation and Markdown Extra documentation for tables, footnotes, and more.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Plain text

  • HTML 태그를 사용할 수 없습니다.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 줄과 단락은 자동으로 분리됩니다.
댓글 첨부 파일
이 댓글에 이미지나 파일을 업로드 합니다.
파일 크기는 8 MB보다 작아야 합니다.
허용할 파일 형식: txt pdf doc xls gif jpg jpeg mp3 png rar zip.
CAPTCHA
이것은 자동으로 스팸을 올리는 것을 막기 위해서 제공됩니다.