IzzyMenu.com

Programming(Script,ASSM,Unix-C)

 ·Î±×ÀÎ  È¸¿ø°¡ÀÔ

CygWin ¿¡¼­ Crontab ¹®Á¦ ÇØ°á
ANTON  2010-08-18 15:57:20, Á¶È¸ : 849, Ãßõ : 45

Skip to content

Skip to search - Accesskey = s

Lum7671's Weblog
Cygwin, cron / crontab, cron-config »ç¿ë±â.
Posted in Software, Windows by lum7671 on 2008/07/24
ÀÌÀü ¹®¼­¸¦ µÚÁ®¼­ ¡°Cygwin, cron / crontab »ç¿ëÇϱ⡱¸¦ Àû¾ú´Âµ¥ ÀÌ°Ô ¿À·¡µÈ °ÍÀÌ°í ȸ»ç¿¡¼­ AD ½Ã½ºÅÛÀ» »ç¿ëÇϱ⠶§¹®¿¡ ÀϹÝÀûÀ¸·Î »ç¿ëÇÏ´Â ¼³Á¤À¸·Î µÇÁö ¾Ê¾Ò´Ù.

/usr/bin/cron-config : ÀÚµ¿À¸·Î Windows Service¿¡ µî·ÏÇØÁÖ´Â ¸í·ÉÀÌ´Ù.
/usr/bin/cygrunsrv : Windows Service °ü·Ã µÈ Cygwin ¸í·ÉÀÌ´Ù.
/usr/bin/cronevents : Cron °ü·Ã event log º¸´Â ÇÁ·Î±×·¥ÀÌ´Ù.

[±×¸² 1] cron-config ½ÇÇà È­¸é



ANTON
$ which cron-config
/usr/bin/cron-config
$ cron-config
Do you want to install the cron daemon as a service? (yes/no) yes
Enter the value of CYGWIN for the daemon: [ ] Cygwin Cron
ERROR: Only "[no]ntsec" "[no]smbntsec" "[no]traverse" allowed.
Enter the value of CYGWIN for the daemon: [ ] ntsec

You must decide under what account the cron daemon will run.
If you are the only user on this machine, the daemon can run as yourself.
This gives access to all network drives but only allows you as user.
Otherwise cron should run under the local system account.
It will be capable of changing to other users without requiring a
password, using one of the three methods detailed in
http://cygwin.com/cygwin-ug-net/ntsec.html#ntsec-nopasswd1
Do you want the cron daemon to run as yourself? (yes/no) no


Running cron_diagnose ...
... 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.

Examine also any cron.log file in the HOME directory
(or the file specified in MAILTO) and cron related files in /tmp.

If you cannot fix the problem, then report it to cygwin@cygwin.com.
Please run the script /usr/bin/cronbug and ATTACH its output
(the file cronbug.txt) to your e-mail.

WARNING: PATH may be set differently under cron than in interactive shells.
Names such as "find" and "date" may refer to Windows programs.

$ cygrunsrv -R "Cron daemon"
cygrunsrv: Error removing a service: OpenService: Win32 error 1060:
The specified service does not exist as an installed service.

$ cygrunsrv -R cron
$ cron-config
Do you want to install the cron daemon as a service? (yes/no) yes
Enter the value of CYGWIN for the daemon: [ ] ntsec

You must decide under what account the cron daemon will run.
If you are the only user on this machine, the daemon can run as yourself.
This gives access to all network drives but only allows you as user.
Otherwise cron should run under the local system account.
It will be capable of changing to other users without requiring a
password, using one of the three methods detailed in
http://cygwin.com/cygwin-ug-net/ntsec.html#ntsec-nopasswd1
Do you want the cron daemon to run as yourself? (yes/no) yes

Please enter the password for user 'liqy':
Reenter:
Running cron_diagnose ...
... 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.

Examine also any cron.log file in the HOME directory
(or the file specified in MAILTO) and cron related files in /tmp.

If you cannot fix the problem, then report it to cygwin@cygwin.com.
Please run the script /usr/bin/cronbug and ATTACH its output
(the file cronbug.txt) to your e-mail.

WARNING: PATH may be set differently under cron than in interactive shells.
Names such as "find" and "date" may refer to Windows programs.

$ cat /var/log/cron.log
/usr/sbin/cron: can't lock /var/run/cron.pid, otherpid may be 4428: Resource temporarily unavailable
/usr/sbin/cron: can't lock /var/run/cron.pid, otherpid may be 4428: Resource temporarily unavailable
$ ps -ef |grep 4428
SYSTEM 4428 1 ? 13:46:40 /usr/sbin/cron
$ > /var/log/cron.log
$ cat /var/log/cron.log
$ crontab -l
# DO NOT EDIT THIS FILE - edit the master and reinstall.
# (t.cron installed on Mon Jun 21 13:41:56 2010)
# (Cron version V5.0 -- $Id: crontab.c,v 1.12 2004/01/23 18:56:42 vixie Exp $)
* * * * * date>>t.log
$ pwd
/home/liqy
$ cat t.log
Mon Jun 21 13:47:02 MPST 2010
Mon Jun 21 13:48:02 MPST 2010
Mon Jun 21 13:49:02 MPST 2010
Mon Jun 21 13:50:03 MPST 2010
Mon Jun 21 13:51:03 MPST 2010
Mon Jun 21 13:52:02 MPST 2010
Mon Jun 21 13:53:02 MPST 2010
Mon Jun 21 13:54:02 MPST 2010
Mon Jun 21 13:55:02 MPST 2010
2010-08-18
19:38:05

 


ANTON
chmod -R 777 /var 2010-08-18
19:57:37

 


ANTON
¼³Ä¡ ¹× ½ÇÇà
cygrunsrv -I cron -p /usr/sbin/cron -a -D
cron-config·Î ¼³Á¤ È®ÀÎ ÇÊ¿ä

net start cron
¶Ç´Â
cygrunsrv -S cron
¶Ç´Â
services.msc (¼­ºñ½º°ü¸® â)

ÀÛ¾÷µî·Ï
crontab -e

/usr/bin/cron-config : ÀÚµ¿À¸·Î Windows Service¿¡ µî·ÏÇØÁÖ´Â ¸í·ÉÀÌ´Ù.
/usr/bin/cygrunsrv : Windows Service °ü·Ã µÈ Cygwin ¸í·ÉÀÌ´Ù.
/usr/bin/cronevents : Cron °ü·Ã event log º¸´Â ÇÁ·Î±×·¥ÀÌ´Ù.

http://www.devdaily.com/blog/post/linux-unix/get-crontab-started-running-when-using-cygwin/
http://lum7671.wordpress.com/2008/07/23/cygwin-cron-crontab-%EC%82%AC%EC%9A%A9%ED%95%98%EA%B8%B0/
http://atheos.tistory.com/50
http://lum7671.wordpress.com/2008/07/24/cygwin-cron-crontab-cron-config-%EC%82%AC%EC%9A%A9%EA%B8%B0/
http://csc.csudh.edu/kleyba/cygwin-cron.pdf

trouble shooting
permission ¹®Á¦
chmod o+x /var
http://www.nabble.com/Wrong-Permission-on-the--var-directory-td18713386.html
can't lock /var/run/crond.pid
ÇÁ·Î¼¼½º¸¦ Á×ÀÏ °Í

[Ãâó] Cygwin¿¡¼­ Crontab »ç¿ëÇϱâ|ÀÛ¼ºÀÚ ¶óÄïÅ·
2010-08-18
19:58:01

 


ANTON
¿¹)¸Å 2ºÐ¸¶´Ù ½ÇÇàÇϱâ
*/2 * * * * /cygdrive/e/Batch/scedule/rsjavaup10m.bat
¿¹)¸ÅÀÏ ¿ÀÀü 9:05ºÐ¿¡ ½ÇÇàÇϱâ
05 9 * * * /cygdrive/e/Batch/scedule/delevery10.bat
2010-08-18
20:04:19

 


  ÃßõÇÏ±â   ¸ñ·Ïº¸±â

Copyright 1999-2024 Zeroboard / skin by zero