cygwin
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revision | |||
| cygwin [2018/12/08 12:49] – created 0.0.0.0 | cygwin [2019/01/30 11:32] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ====== Cygwin ====== | + | ==== How to run a crontab in Cygwin on Windows ==== |
| - | + | Just to mention first that you could bypass cron altogether with this little trick:\\ | |
| - | =====How to run a crontab in Cygwin on Windows===== | + | |
| - | Just to mention first that you could bypass cron altogether with this little trick:<br /> | + | |
| Create a scheduled task with the windows scheduler by calling the shell program | Create a scheduled task with the windows scheduler by calling the shell program | ||
| - | < | + | < |
| + | C: | ||
| + | </ | ||
| **otherwise...** | **otherwise...** | ||
| - | * Install cygrunsrv and cron packages from the admin bundle (with ' | + | * Install cygrunsrv and cron packages from the admin bundle (with ' |
| - | * From a Cygwin prompt, to install the cron daemon as a service type: | + | * From a Cygwin prompt, to install the cron daemon as a service type: |
| - | < | + | < |
| - | * Start the cron daemon from a Windows prompt with: | + | cygrunsrv --install cron --path / |
| - | < | + | </ |
| + | * Start the cron daemon from a Windows prompt with: | ||
| + | < | ||
| + | net start cron | ||
| + | </ | ||
| or from a Cygwin prompt with: | or from a Cygwin prompt with: | ||
| - | < | + | < |
| + | cygrunsrv --start cron | ||
| + | </ | ||
| Now change the properties on the service to run as a user other than "Local System" | Now change the properties on the service to run as a user other than "Local System" | ||
| - | ====Configure cron==== | + | === Configure cron === |
| Run this from a Cygwin terminal | Run this from a Cygwin terminal | ||
| - | < | + | < |
| + | cron-config | ||
| + | </ | ||
| Show system log of possible problems from the cron daemon (service) | Show system log of possible problems from the cron daemon (service) | ||
| - | < | + | < |
| + | / | ||
| + | </ | ||
| - | =====Diagnose problems===== | + | ==== Diagnose problems ==== |
| Check installed modules | Check installed modules | ||
| - | < | + | < |
| + | cygcheck.exe -c | ||
| + | </ | ||
| Check current status | Check current status | ||
| - | < | + | < |
| + | cygrunsrv -Q cron | ||
| + | </ | ||
| If you get | If you get | ||
| - | < | + | < |
| + | (CRON) error (can't switch user context) | ||
| + | </ | ||
| this means that the cron service is trying to run jobs as the "Local System" | this means that the cron service is trying to run jobs as the "Local System" | ||
| + | |||
cygwin.1544273360.txt.gz · Last modified: 2018/12/08 12:49 by 0.0.0.0
