User Tools

Site Tools


cygwin

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
cygwin [2018/12/08 12:49] – created 0.0.0.0cygwin [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
-<code>0@@</code>+<code> 
 +C:\\cygwin\\bin\\bash.exe -l -c /cygwin/path/to/shell 
 +</code>
 **otherwise...** **otherwise...**
-  * Install cygrunsrv and cron packages from the admin bundle (with 'Install from internet" option) +  *  Install cygrunsrv and cron packages from the admin bundle (with 'Install from internet" option) 
-  * 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: 
-<code>1@@</code> +<code> 
-  * Start the cron daemon from a Windows prompt with: +cygrunsrv --install cron --path /usr/sbin/cron --args -n 
-<code>2@@</code>+</code> 
 +  *  Start the cron daemon from a Windows prompt with: 
 +<code> 
 +net start cron 
 +</code>
 or from a Cygwin prompt with: or from a Cygwin prompt with:
-<code>3@@</code>+<code> 
 +cygrunsrv --start cron 
 +</code>
 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
-<code>4@@</code>+<code> 
 +cron-config 
 +</code>
 Show system log of possible problems from the cron daemon (service) Show system log of possible problems from the cron daemon (service)
-<code>5@@</code>+<code> 
 +/usr/bin/cronevents 
 +</code>
  
-=====Diagnose problems=====+==== Diagnose problems ====
 Check installed modules Check installed modules
-<code>6@@</code>+<code> 
 +cygcheck.exe -c 
 +</code>
 Check current status Check current status
-<code>7@@</code>+<code> 
 +cygrunsrv -Q cron 
 +</code>
 If you get If you get
-<code>8@@</code>+<code> 
 +(CRON) error (can't switch user context) 
 +</code>
 this means that the cron service is trying to run jobs as the "Local System" account. Right-click on the service and change the user it runs jobs as to be the one you want. this means that the cron service is trying to run jobs as the "Local System" account. Right-click on the service and change the user it runs jobs as to be the one you want.
 +
cygwin.1544273360.txt.gz · Last modified: 2018/12/08 12:49 by 0.0.0.0

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki