Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Running Cronjob under cygwin

I have script which need to run using cygwin crontab.

So what i have done.

installed two additional cygwin packages using cygwin setup.exe

Cron and cygrunsrv

Then in installed the new crontab

* * * * * sh /housekeeper.sh -t CPS 

since i could not get the output of the housekeeper.sh, i checked the status of

cronevents.exe

This gives me following error message.

2012/05/28 18:22:01 [SYSTEM] /usr/sbin/cron: PID 3880: (CRON) error (can't switc
h user context)

could anybody help me with this issue.

Thanks in advance for anyhelp

like image 278
KItis Avatar asked Dec 03 '25 16:12

KItis


1 Answers

This error appears in the Windows Application Event Log and occurs because the account running the service can't switch user context (see http://www.davidjnice.com/cygwin_cron_service.html)

Change the user who runs the service to the real user who has to run the script.

like image 174
David Pérez Serrada Avatar answered Dec 06 '25 06:12

David Pérez Serrada