Cygwinã§cronã使ãã¨ãã®ã¡ã¢
googleã§æ¤ç´¢ãããããã«åºã¾ããã
æé
ã¾ããCygwinã®ã¤ã³ã¹ãã¼ã©ã¼ï¼setup.exeï¼ããcygrunsrvã¨cronãã¤ã³ã¹ãã¼ã«ãã¦ããããã¨ãcrontabç·¨éã®ããã«vi(m)ã¨ããã¤ã³ã¹ãã¼ã«ãã¦ããã¨ããããã
ã¤ã³ã¹ãã¼ã«å¾ããµã¼ãã¹ã«ç»é²ããã
$ cygrunsrv -I cron -p /usr/sbin/cron -a -n
cygrunsrv -S ã§ã¹ã¿ã¼ãã
$ cygrunsrv -S cron
cygrunsrv -Q ã§ç¶æ ã確èªã
$ cygrunsrv -Q cron Service : cron Current State : Running Controls Accepted : Stop Command : /usr/sbin/cron -n
ã¨ããã§ãWebã§èª¿ã¹ãã¨cronã®å¼æ°ã«-Dãæå®ãã¦ããµã¤ãã°ã£ããã ã£ããã ãã©*1ã-Dã£ã¦ãªãã ï¼ããã¥ã¢ã«ã«ãè¼ã£ã¦ãªããã»ã»ã»ã試ãã¦ã¿ãã¨ã-Dãã¤ããã¨foregroundã§åãã¦ãã¿ããã ãã©ã
ã½ã¼ã¹ãè¦ã¦ã¿ãã¨ãNoForkãªãã·ã§ã³ã¿ããã§ãããbackward compatibilityã®ããã«æ®ãã¦ãããã©ãä»ã¯-nãªãã·ã§ã³ã使ã£ãã»ããããã¿ããã
static void parse_args(int argc, char *argv[]) { int argch; while (-1 != (argch = getopt(argc, argv, "Dnx:"))) { switch (argch) { default: usage(); case 'x': if (!set_debug_flags(optarg)) usage(); break; case 'D': /* Cygwin backward compatibility */ case 'n': NoFork = 1; break; } } }
ããã¥ã¢ã«ã«ãæ¸ãã¦ããã¾ããã
The -n option changes this default behavior causing it to run in the fore-
ground. This can be useful when starting it out of init.
ãã¨ã¯ããã¤ã³ã³ãã¥ã¼ã¿ã¼ãå³ã¯ãªãã¯ãã¦ãã管çãâããµã¼ãã¹ã¨ã¢ããªã±ã¼ã·ã§ã³ãããcronãé¸ãã§ãå¿ è¦ã«å¿ãã¦ããã¹ã¯ãããã¨ã®å¯¾è©±ããµã¼ãã¹ã«è¨±å¯ãããã§ãã¯ããã
ãã¼
ããã©ããããã¨ããWindowsã®ã¿ã¹ã¯ã¹ã±ã¸ã¥ã¼ã©ã¼ã¨ç«¶åãããããã¨ãæã£ã¦å¾®å¦ã«æ¬é ãã¦ããã©ãæ¡å¤æ¥½ã¡ãã ãªããviå
¥ããã¨ä½¿ãããã¡ã¯UNIXã¨å¤ãããªããcygrunsrvã®ä½¿ãåæããæUNIXã®ãµã¼ãã¹ç£è¦ç³»ã³ãã³ãã«ä¼¼ã¦ã¦*2楽ããããããã¯ç©æ¥µçã«ä½¿ã£ã¦ãããããã¿ã¹ã¯ã¹ã±ã¸ã¥ã¼ã©ã¼ããä¿å®ãç°¡åã ãããcrontabãã³ãã¼ãã¨ããããããã ãã
追è¨
ãããcrontabã«ã³ãããã¦ããã¨ä¾¿å©ããã¤ãå¿ãããã ããã
# * * * * * command to be executed # - - - - - # | | | | | # | | | | +----- day of week (0 - 6) (Sunday=0) # | | | +------- month (1 - 12) # | | +--------- day of month (1 - 31) # | +----------- hour (0 - 23) # +------------- min (0 - 59) # minute hour day_of_month month weekday command
追è¨2
æåã§è¨å®ããã¨åããªããã¨ãããã®ã§ãcron-config ã§è¨å®ããã»ãããããã
ãã¨ãåããªãã¨ã㯠/usr/bin/cronevents ãå®è¡ããã¨ãã°ãåºã¦ãã¾ããï¼Windowsã®ã¤ãã³ããã°ã®ããã§ãï¼
追è¨3
croneventsã§"WRONG FILE OWNER"ãåºãã¨ãã¯ã/etc/passwd 㨠/etc/group ã®è¨å®ãæ£ããã確èªãã¾ãããã
- ã¦ã¼ã¶ã¼ID
- ã°ã«ã¼ãID
- ãã¼ã ãã£ã¬ã¯ããª
ãªã©ã