This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: Cron not working
- From: "Larry Hall (Cygwin)" <reply-to-list-only-lh at cygwin dot com>
- To: cygwin at cygwin dot com
- Date: Tue, 10 Mar 2015 11:46:16 -0400
- Subject: Re: Cron not working
- Authentication-results: sourceware.org; auth=none
- References: <5440CEFE64DE65479B2056BDE1CEA4511653B01A at MARIA dot win dot idev dot lan>
- Reply-to: cygwin at cygwin dot com
On 03/10/2015 09:48 AM, Stefan Schumacher wrote:
Hello
I am trying to set up a cron job to run a script every 10 minutes. I
have installed cron via the installer and configured it with cron-config
to run as a system service.
Mar 10 14:11:33 stefan-PC cron: PID 3408: `cron' service started
This is stefan's crontab, generated with crontab -e.
*/10 * * * * /cygdrive/c/Users/stefan/copy_from_fileserver
According to /var/log/messages the cron job is executed correctly, but
no test file is generated in the directory. Calling copy_from_fileserver
from the command line works without complications and copies the
file from the server as it should.
Mar 10 14:40:01 stefan-PC /usr/sbin/cron: PID 2340: (stefan) CMD (/cygdrive/c/Users/stefan/copy_from_fileserver)
How can I get this working?
First, we need to know what your script is doing and what your configuration
is, both for cron and for Cygwin. Check out the problem reporting
guidelines at the link below for details.
Problem reports: http://cygwin.com/problems.html
Just a wild guess based on what you said so far, your script requires
resources (paths, environment variables, permissions, etc.) that aren't
available to the script when it runs. Keep in mind that the script isn't
being run by your user and as a result, you can't assume that your user's
environment exists when it runs. If your script assumes these things, it
will fail. To solve this problem, you need to identify the needed resources
and make sure they are available when the script runs. This may be as
simple as running the crond service under your user's account (this means
that the service can _only_ service your user's account though) or adding
some needed environment to your script.
--
Larry
_____________________________________________________________________
A: Yes.
> Q: Are you sure?
>> A: Because it reverses the logical flow of conversation.
>>> Q: Why is top posting annoying in email?
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple