public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* How to start and verify cron?
@ 2019-07-10 16:55 David Karr
  2019-07-10 17:19 ` Brian Inglis
  0 siblings, 1 reply; 17+ messages in thread
From: David Karr @ 2019-07-10 16:55 UTC (permalink / raw)
  To: The Cygwin Mailing List

I've checked the user guide and the FAQ, and I can't find any information
about how to start cron and verify that it's working.  I found other blog
posts on other sites, but some of them are old.

I had installed cron, and I thought it was working, but now I think that it
is not.  If I edit "~/crontab" and then run "crontab -l", it lists the
changes I've made to jobs, so at least that is working.  The real job I
have didn't appear to be doing what it was supposed to be doing, so I added
a new trivial job that just appends output from "date" to a file in my
homedir, and after the scheduled time of the job, the file was not created.

This is the additional job I added:

    40,42,44 * * * * date >> /home/<myuid>/date.txt

I did find a "/var/log/cron.log", but it is empty, and the modtime is from
a few months ago.

One blog post I found talks about running "cygrunsrv -I cron -p
/usr/sbin/cron -a -D". I just did this, and it reports "The specified
service already exists."

This is my uname -a output:

    CYGWIN_NT-6.1 ... 3.0.3(0.338/5/3) 2019-03-09 19:12 x86_64 Cygwin

--
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

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: How to start and verify cron?
  2019-07-10 16:55 How to start and verify cron? David Karr
@ 2019-07-10 17:19 ` Brian Inglis
  2019-07-10 22:15   ` David Karr
  0 siblings, 1 reply; 17+ messages in thread
From: Brian Inglis @ 2019-07-10 17:19 UTC (permalink / raw)
  To: cygwin

On 2019-07-10 10:55, David Karr wrote:
> I've checked the user guide and the FAQ, and I can't find any information
> about how to start cron and verify that it's working.  I found other blog
> posts on other sites, but some of them are old.

Did you run service setup script /bin/cron-config to set up the service?

> I had installed cron, and I thought it was working, but now I think that it
> is not.  If I edit "~/crontab" and then run "crontab -l", it lists the
> changes I've made to jobs, so at least that is working.  The real job I
> have didn't appear to be doing what it was supposed to be doing, so I added
> a new trivial job that just appends output from "date" to a file in my
> homedir, and after the scheduled time of the job, the file was not created.

Messages from cron and other active services should be visible in the Windows
application event log if you have not set up a syslog service.

> This is the additional job I added:
> 
>     40,42,44 * * * * date >> /home/<myuid>/date.txt
> 
> I did find a "/var/log/cron.log", but it is empty, and the modtime is from
> a few months ago.
> 
> One blog post I found talks about running "cygrunsrv -I cron -p
> /usr/sbin/cron -a -D". I just did this, and it reports "The specified
> service already exists."
> 
> This is my uname -a output:
> 
>     CYGWIN_NT-6.1 ... 3.0.3(0.338/5/3) 2019-03-09 19:12 x86_64 Cygwi
For a more Unix like and self contained Cygwin approach, install syslog-ng, run
service setup scripts /bin/cygserver-config /bin/syslog-ng-config
/bin/cron-config, add service dependencies to start up in that order, and you
should see cron messages in /var/log/syslog if you run elevated: you can also
run chmod elevated to make /var/log/syslog world readable, or setfacl to add
user or group read ACLs.

-- 
Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada

This email may be disturbing to some readers as it contains
too much technical detail. Reader discretion is advised.

--
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

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: How to start and verify cron?
  2019-07-10 17:19 ` Brian Inglis
@ 2019-07-10 22:15   ` David Karr
  2019-07-10 23:04     ` Brian Inglis
  0 siblings, 1 reply; 17+ messages in thread
From: David Karr @ 2019-07-10 22:15 UTC (permalink / raw)
  To: Brian.Inglis, The Cygwin Mailing List

On Wed, Jul 10, 2019 at 10:20 AM Brian Inglis <
Brian.Inglis@systematicsw.ab.ca> wrote:

> On 2019-07-10 10:55, David Karr wrote:
> > I've checked the user guide and the FAQ, and I can't find any information
> > about how to start cron and verify that it's working.  I found other blog
> > posts on other sites, but some of them are old.
>
> Did you run service setup script /bin/cron-config to set up the service?
>

When I ran that now, it says "Cron is already installed as a service under
account ...", so I assume that means that I did.


> > I had installed cron, and I thought it was working, but now I think that
> it
> > is not.  If I edit "~/crontab" and then run "crontab -l", it lists the
> > changes I've made to jobs, so at least that is working.  The real job I
> > have didn't appear to be doing what it was supposed to be doing, so I
> added
> > a new trivial job that just appends output from "date" to a file in my
> > homedir, and after the scheduled time of the job, the file was not
> created.
>
> Messages from cron and other active services should be visible in the
> Windows
> application event log if you have not set up a syslog service.
>

I went through it, but I didn't see any indications of issues with cron.
I'm not sure what to look for, or where in the event log interface.


> > This is the additional job I added:
> >
> >     40,42,44 * * * * date >> /home/<myuid>/date.txt
> >
> > I did find a "/var/log/cron.log", but it is empty, and the modtime is
> from
> > a few months ago.
> >
> > One blog post I found talks about running "cygrunsrv -I cron -p
> > /usr/sbin/cron -a -D". I just did this, and it reports "The specified
> > service already exists."
> >
> > This is my uname -a output:
> >
> >     CYGWIN_NT-6.1 ... 3.0.3(0.338/5/3) 2019-03-09 19:12 x86_64 Cygwi
> For a more Unix like and self contained Cygwin approach, install
> syslog-ng, run
> service setup scripts /bin/cygserver-config /bin/syslog-ng-config
> /bin/cron-config, add service dependencies to start up in that order, and
> you
> should see cron messages in /var/log/syslog if you run elevated: you can
> also
> run chmod elevated to make /var/log/syslog world readable, or setfacl to
> add
> user or group read ACLs.
>

How do I add service dependencies to start up in a particular order?


> --
> Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada
>
> This email may be disturbing to some readers as it contains
> too much technical detail. Reader discretion is advised.
>
> --
> 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
>
>

--
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

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: How to start and verify cron?
  2019-07-10 22:15   ` David Karr
@ 2019-07-10 23:04     ` Brian Inglis
  2019-07-11 19:57       ` David Karr
  0 siblings, 1 reply; 17+ messages in thread
From: Brian Inglis @ 2019-07-10 23:04 UTC (permalink / raw)
  To: The Cygwin Mailing List

On 2019-07-10 16:15, David Karr wrote:
> On Wed, Jul 10, 2019 at 10:20 AM Brian Inglis wrote:
>     On 2019-07-10 10:55, David Karr wrote:
>     > I've checked the user guide and the FAQ, and I can't find any information
>     > about how to start cron and verify that it's working.  I found other blog
>     > posts on other sites, but some of them are old.
> 
>     Did you run service setup script /bin/cron-config to set up the service?
> When I ran that now, it says "Cron is already installed as a service under
> account ...", so I assume that means that I did.
>     > I had installed cron, and I thought it was working, but now I think that it
>     > is not.  If I edit "~/crontab" and then run "crontab -l", it lists the
>     > changes I've made to jobs, so at least that is working.  The real job I
>     > have didn't appear to be doing what it was supposed to be doing, so I added
>     > a new trivial job that just appends output from "date" to a file in my
>     > homedir, and after the scheduled time of the job, the file was not created.
> 
>     Messages from cron and other active services should be visible in the Windows
>     application event log if you have not set up a syslog service.
> I went through it, but I didn't see any indications of issues with cron.  I'm
> not sure what to look for, or where in the event log interface.
>     > This is the additional job I added:
>     >
>     >     40,42,44 * * * * date >> /home/<myuid>/date.txt
>     >
>     > I did find a "/var/log/cron.log", but it is empty, and the modtime is from
>     > a few months ago.
>     >
>     > One blog post I found talks about running "cygrunsrv -I cron -p
>     > /usr/sbin/cron -a -D". I just did this, and it reports "The specified
>     > service already exists."
>     >
>     > This is my uname -a output:
>     >
>     >     CYGWIN_NT-6.1 ... 3.0.3(0.338/5/3) 2019-03-09 19:12 x86_64 Cygwi
>     For a more Unix like and self contained Cygwin approach, install syslog-ng, run
>     service setup scripts /bin/cygserver-config /bin/syslog-ng-config
>     /bin/cron-config, add service dependencies to start up in that order, and you
>     should see cron messages in /var/log/syslog if you run elevated: you can also
>     run chmod elevated to make /var/log/syslog world readable, or setfacl to add
>     user or group read ACLs.
> How do I add service dependencies to start up in a particular order?

In an elevated cmd or bash shell:
elevated > OR # sc config syslog-ng depend= cygserver
elevated > OR # sc config cron depend= syslog-ng/cygserver
N.B. the "=" is part of each keyword; multiple service dependencies are
separated by "/".

-- 
Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada

This email may be disturbing to some readers as it contains
too much technical detail. Reader discretion is advised.

--
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

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: How to start and verify cron?
  2019-07-10 23:04     ` Brian Inglis
@ 2019-07-11 19:57       ` David Karr
  2019-07-11 20:12         ` Vince Rice
  2019-07-11 21:20         ` David Karr
  0 siblings, 2 replies; 17+ messages in thread
From: David Karr @ 2019-07-11 19:57 UTC (permalink / raw)
  To: Brian.Inglis, The Cygwin Mailing List

It's curious that when I bring up the default "Packages" view, filtering
for "syslog-ng" doesn't find anything.  I had to switch to the Categories
view, and then filtering for that found it.

On Wed, Jul 10, 2019 at 4:04 PM Brian Inglis <
Brian.Inglis@systematicsw.ab.ca> wrote:

> On 2019-07-10 16:15, David Karr wrote:
> > On Wed, Jul 10, 2019 at 10:20 AM Brian Inglis wrote:
> >     On 2019-07-10 10:55, David Karr wrote:
> >     > I've checked the user guide and the FAQ, and I can't find any
> information
> >     > about how to start cron and verify that it's working.  I found
> other blog
> >     > posts on other sites, but some of them are old.
> >
> >     Did you run service setup script /bin/cron-config to set up the
> service?
> > When I ran that now, it says "Cron is already installed as a service
> under
> > account ...", so I assume that means that I did.
> >     > I had installed cron, and I thought it was working, but now I
> think that it
> >     > is not.  If I edit "~/crontab" and then run "crontab -l", it lists
> the
> >     > changes I've made to jobs, so at least that is working.  The real
> job I
> >     > have didn't appear to be doing what it was supposed to be doing,
> so I added
> >     > a new trivial job that just appends output from "date" to a file
> in my
> >     > homedir, and after the scheduled time of the job, the file was not
> created.
> >
> >     Messages from cron and other active services should be visible in
> the Windows
> >     application event log if you have not set up a syslog service.
> > I went through it, but I didn't see any indications of issues with
> cron.  I'm
> > not sure what to look for, or where in the event log interface.
> >     > This is the additional job I added:
> >     >
> >     >     40,42,44 * * * * date >> /home/<myuid>/date.txt
> >     >
> >     > I did find a "/var/log/cron.log", but it is empty, and the modtime
> is from
> >     > a few months ago.
> >     >
> >     > One blog post I found talks about running "cygrunsrv -I cron -p
> >     > /usr/sbin/cron -a -D". I just did this, and it reports "The
> specified
> >     > service already exists."
> >     >
> >     > This is my uname -a output:
> >     >
> >     >     CYGWIN_NT-6.1 ... 3.0.3(0.338/5/3) 2019-03-09 19:12 x86_64
> Cygwi
> >     For a more Unix like and self contained Cygwin approach, install
> syslog-ng, run
> >     service setup scripts /bin/cygserver-config /bin/syslog-ng-config
> >     /bin/cron-config, add service dependencies to start up in that
> order, and you
> >     should see cron messages in /var/log/syslog if you run elevated: you
> can also
> >     run chmod elevated to make /var/log/syslog world readable, or
> setfacl to add
> >     user or group read ACLs.
> > How do I add service dependencies to start up in a particular order?
>
> In an elevated cmd or bash shell:
> elevated > OR # sc config syslog-ng depend= cygserver
> elevated > OR # sc config cron depend= syslog-ng/cygserver
> N.B. the "=" is part of each keyword; multiple service dependencies are
> separated by "/".
>
> --
> Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada
>
> This email may be disturbing to some readers as it contains
> too much technical detail. Reader discretion is advised.
>
> --
> 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
>
>

--
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

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: How to start and verify cron?
  2019-07-11 19:57       ` David Karr
@ 2019-07-11 20:12         ` Vince Rice
  2019-07-11 20:23           ` Vince Rice
  2019-07-11 21:20         ` David Karr
  1 sibling, 1 reply; 17+ messages in thread
From: Vince Rice @ 2019-07-11 20:12 UTC (permalink / raw)
  To: The Cygwin Mailing List

> On Jul 11, 2019, at 2:56 PM, David Karr wrote:
> 
> It's curious that when I bring up the default "Packages" view, filtering
> for "syslog-ng" doesn't find anything.  I had to switch to the Categories
> view, and then filtering for that found it.

Not that curious. Setup's search is searching packages contained within
the current view. "Packages" is not one of the drop-down options for View.
The default view is, I believe, Pending, or at least that's what always opens 
for me. And it wouldn't show up in Pending for you since it's not installed on
your PC and therefore can't be pending. Categories (and Full) both show all
packages, and therefore it would be found in those views.

Also, please don't top post. https://cygwin.com/acronyms/#TOFU
--
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

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: How to start and verify cron?
  2019-07-11 20:12         ` Vince Rice
@ 2019-07-11 20:23           ` Vince Rice
  2019-07-11 21:18             ` David Karr
  0 siblings, 1 reply; 17+ messages in thread
From: Vince Rice @ 2019-07-11 20:23 UTC (permalink / raw)
  To: The Cygwin Mailing List

> On Jul 11, 2019, at 3:12 PM, Vince Rice wrote:
> 
>> On Jul 11, 2019, at 2:56 PM, David Karr wrote:
>> 
>> It's curious that when I bring up the default "Packages" view, filtering
>> for "syslog-ng" doesn't find anything.  I had to switch to the Categories
>> view, and then filtering for that found it.
> 
> Not that curious. Setup's search is searching packages contained within
> the current view. "Packages" is not one of the drop-down options for View.
> The default view is, I believe, Pending, or at least that's what always opens 
> for me. And it wouldn't show up in Pending for you since it's not installed on
> your PC and therefore can't be pending. Categories (and Full) both show all
> packages, and therefore it would be found in those views.
> 
> Also, please don't top post. https://cygwin.com/acronyms/#TOFU

And https://cygwin.com/acronyms/#PCYMTNQREAIYR. (Sorry, missed that
the first time.)
--
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

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: How to start and verify cron?
  2019-07-11 20:23           ` Vince Rice
@ 2019-07-11 21:18             ` David Karr
  2019-07-11 21:52               ` Vince Rice
  0 siblings, 1 reply; 17+ messages in thread
From: David Karr @ 2019-07-11 21:18 UTC (permalink / raw)
  To: The Cygwin Mailing List

On Thu, Jul 11, 2019 at 1:23 PM Vince Rice <vrice@solidrocksystems.com>
wrote:

> > On Jul 11, 2019, at 3:12 PM, Vince Rice wrote:
> >
> >> On Jul 11, 2019, at 2:56 PM, David Karr wrote:
> >>
> >> It's curious that when I bring up the default "Packages" view, filtering
> >> for "syslog-ng" doesn't find anything.  I had to switch to the
> Categories
> >> view, and then filtering for that found it.
> >
> > Not that curious. Setup's search is searching packages contained within
> > the current view. "Packages" is not one of the drop-down options for
> View.
> > The default view is, I believe, Pending, or at least that's what always
> opens
> > for me. And it wouldn't show up in Pending for you since it's not
> installed on
> > your PC and therefore can't be pending. Categories (and Full) both show
> all
> > packages, and therefore it would be found in those views.
> >
> > Also, please don't top post. https://cygwin.com/acronyms/#TOFU
>
> And https://cygwin.com/acronyms/#PCYMTNQREAIYR. (Sorry, missed that
> the first time.)
>

I typically try to avoid top-posting, but I'm pretty sure I won't be able
to do anything about the mailer configuration.

--
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

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: How to start and verify cron?
  2019-07-11 19:57       ` David Karr
  2019-07-11 20:12         ` Vince Rice
@ 2019-07-11 21:20         ` David Karr
  2019-07-11 22:57           ` René Berber
  2019-07-12 15:20           ` Brian Inglis
  1 sibling, 2 replies; 17+ messages in thread
From: David Karr @ 2019-07-11 21:20 UTC (permalink / raw)
  To: Brian.Inglis, The Cygwin Mailing List

On Thu, Jul 11, 2019 at 12:56 PM David Karr <davidmichaelkarr@gmail.com>
wrote:

> It's curious that when I bring up the default "Packages" view, filtering
> for "syslog-ng" doesn't find anything.  I had to switch to the Categories
> view, and then filtering for that found it.
>
> On Wed, Jul 10, 2019 at 4:04 PM Brian Inglis <
> Brian.Inglis@systematicsw.ab.ca> wrote:
>
>> On 2019-07-10 16:15, David Karr wrote:
>> > On Wed, Jul 10, 2019 at 10:20 AM Brian Inglis wrote:
>> >     On 2019-07-10 10:55, David Karr wrote:
>> >     > I've checked the user guide and the FAQ, and I can't find any
>> information
>> >     > about how to start cron and verify that it's working.  I found
>> other blog
>> >     > posts on other sites, but some of them are old.
>> >
>> >     Did you run service setup script /bin/cron-config to set up the
>> service?
>> > When I ran that now, it says "Cron is already installed as a service
>> under
>> > account ...", so I assume that means that I did.
>> >     > I had installed cron, and I thought it was working, but now I
>> think that it
>> >     > is not.  If I edit "~/crontab" and then run "crontab -l", it
>> lists the
>> >     > changes I've made to jobs, so at least that is working.  The real
>> job I
>> >     > have didn't appear to be doing what it was supposed to be doing,
>> so I added
>> >     > a new trivial job that just appends output from "date" to a file
>> in my
>> >     > homedir, and after the scheduled time of the job, the file was
>> not created.
>> >
>> >     Messages from cron and other active services should be visible in
>> the Windows
>> >     application event log if you have not set up a syslog service.
>> > I went through it, but I didn't see any indications of issues with
>> cron.  I'm
>> > not sure what to look for, or where in the event log interface.
>> >     > This is the additional job I added:
>> >     >
>> >     >     40,42,44 * * * * date >> /home/<myuid>/date.txt
>> >     >
>> >     > I did find a "/var/log/cron.log", but it is empty, and the
>> modtime is from
>> >     > a few months ago.
>> >     >
>> >     > One blog post I found talks about running "cygrunsrv -I cron -p
>> >     > /usr/sbin/cron -a -D". I just did this, and it reports "The
>> specified
>> >     > service already exists."
>> >     >
>> >     > This is my uname -a output:
>> >     >
>> >     >     CYGWIN_NT-6.1 ... 3.0.3(0.338/5/3) 2019-03-09 19:12 x86_64
>> Cygwi
>> >     For a more Unix like and self contained Cygwin approach, install
>> syslog-ng, run
>> >     service setup scripts /bin/cygserver-config /bin/syslog-ng-config
>> >     /bin/cron-config, add service dependencies to start up in that
>> order, and you
>> >     should see cron messages in /var/log/syslog if you run elevated:
>> you can also
>> >     run chmod elevated to make /var/log/syslog world readable, or
>> setfacl to add
>> >     user or group read ACLs.
>> > How do I add service dependencies to start up in a particular order?
>>
>> In an elevated cmd or bash shell:
>> elevated > OR # sc config syslog-ng depend= cygserver
>> elevated > OR # sc config cron depend= syslog-ng/cygserver
>> N.B. the "=" is part of each keyword; multiple service dependencies are
>> separated by "/".
>>
>
After doing all of this, I still can't get cron jobs to work, and I can't
get any info on why.

This is the current output from "crontab -l":

----------------
# DO NOT EDIT THIS FILE - edit the master and reinstall.
# (crontab installed on Thu Jul 11 14:13:09 2019)
# (Cron version V5.0 -- $Id: crontab.c,v 1.12 2004/01/23 18:56:42 vixie Exp
$)
0       0,12    *       *       *       find /tmp/.logcache/ -type f -mtime
+6 -exec rm {} \;
14,15,16,17     *       *       *       *        date >>
/home/dk068x/date.txt
----------------

I've tried editing that last one and changing the minutes to include
upcoming minutes, and then after those minutes, I check the results, and
there are none.  Nothing in cron.log or syslog-ng.log.

--
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

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: How to start and verify cron?
  2019-07-11 21:18             ` David Karr
@ 2019-07-11 21:52               ` Vince Rice
  0 siblings, 0 replies; 17+ messages in thread
From: Vince Rice @ 2019-07-11 21:52 UTC (permalink / raw)
  To: The Cygwin Mailing List

> On Jul 11, 2019, at 4:18 PM, David Karr wrote:
> 
> I typically try to avoid top-posting, but I'm pretty sure I won't be able
> to do anything about the mailer configuration.

Then you'll need to fix it manually, like I just did on yours. Whichever it is, please
stop including email addresses in your replies.
--
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

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: How to start and verify cron?
  2019-07-11 21:20         ` David Karr
@ 2019-07-11 22:57           ` René Berber
  2019-07-11 23:21             ` René Berber
  2019-07-12 15:20           ` Brian Inglis
  1 sibling, 1 reply; 17+ messages in thread
From: René Berber @ 2019-07-11 22:57 UTC (permalink / raw)
  To: cygwin

On 7/11/2019 4:20 PM, David Karr wrote:

>>>> How do I add service dependencies to start up in a particular order?
>>>
>>> In an elevated cmd or bash shell:
>>> elevated > OR # sc config syslog-ng depend= cygserver
>>> elevated > OR # sc config cron depend= syslog-ng/cygserver
>>> N.B. the "=" is part of each keyword; multiple service dependencies are
>>> separated by "/".
>>
> After doing all of this, I still can't get cron jobs to work, and I can't
> get any info on why.

Doing all of "that" doesn't change a running cron daemon; those only
afect the initial run after boot up.

> This is the current output from "crontab -l":
...
> I've tried editing that last one and changing the minutes to include
> upcoming minutes, and then after those minutes, I check the results, and
> there are none.  Nothing in cron.log or syslog-ng.log.

Editing in this context means running 'crontab -e' (which uses vi to
edit the user's cron table).  After exiting that (with ZZ to save &
exit, or :wq) cron sends a message to the log, which, by the way may
need to be configured (i.e. syslog-ng has its own configuration, an in
there may be a line that says where cron's log goes, or if it is ignored).

Restarting the daemon should also produce a line in the log, which is
another notification that it is working.

In Linux I even have set the cron daemon's log level to show the start
of all cron jobs; that parameter in Cygwin would go as optional
parameter in the installation as service ("-L 1" in the cygrunsrv line
of the installation script, or maybe running cygrunsrv again, visible
and editable in the "Start parameters" at the service Properties view).
-- 
R.Berber



--
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

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: How to start and verify cron?
  2019-07-11 22:57           ` René Berber
@ 2019-07-11 23:21             ` René Berber
  0 siblings, 0 replies; 17+ messages in thread
From: René Berber @ 2019-07-11 23:21 UTC (permalink / raw)
  To: cygwin

On 7/11/2019 5:57 PM, René Berber wrote:

> parameter in the installation as service ("-L 1" in the cygrunsrv line

Sorry this is not clear.

I should have writen something like 'cygrunsrv -I ... -a "-L 1" ...'
-- 
R.Berber


--
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

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: How to start and verify cron?
  2019-07-11 21:20         ` David Karr
  2019-07-11 22:57           ` René Berber
@ 2019-07-12 15:20           ` Brian Inglis
  2019-07-12 16:18             ` David Karr
  2019-07-13  7:59             ` Henning
  1 sibling, 2 replies; 17+ messages in thread
From: Brian Inglis @ 2019-07-12 15:20 UTC (permalink / raw)
  To: The Cygwin Mailing List

On 2019-07-11 15:20, David Karr wrote:
> On Thu, Jul 11, 2019 at 12:56 PM David Karr wrote:
>     On Wed, Jul 10, 2019 at 4:04 PM Brian Inglis wrote:
>         On 2019-07-10 16:15, David Karr wrote:
>         > On Wed, Jul 10, 2019 at 10:20 AM Brian Inglis wrote:
>         >     On 2019-07-10 10:55, David Karr wrote:
>         >     > I've checked the user guide and the FAQ, and I can't find any
>         information
>         >     > about how to start cron and verify that it's working.  I found
>         other blog
>         >     > posts on other sites, but some of them are old.
>         >
>         >     Did you run service setup script /bin/cron-config to set up the
>         service?
>         > When I ran that now, it says "Cron is already installed as a service under
>         > account ...", so I assume that means that I did.
>         >     > I had installed cron, and I thought it was working, but now I
>         think that it
>         >     > is not.  If I edit "~/crontab" and then run "crontab -l", it
>         lists the
>         >     > changes I've made to jobs, so at least that is working.  The
>         real job I
>         >     > have didn't appear to be doing what it was supposed to be doing,
>         so I added
>         >     > a new trivial job that just appends output from "date" to a file
>         in my
>         >     > homedir, and after the scheduled time of the job, the file was
>         not created.
>         >
>         >     Messages from cron and other active services should be visible in
>         the Windows
>         >     application event log if you have not set up a syslog service.
>         > I went through it, but I didn't see any indications of issues with
>         cron.  I'm
>         > not sure what to look for, or where in the event log interface.
>         >     > This is the additional job I added:
>         >     >
>         >     >     40,42,44 * * * * date >> /home/<myuid>/date.txt
>         >     >
>         >     > I did find a "/var/log/cron.log", but it is empty, and the
>         modtime is from
>         >     > a few months ago.
>         >     >
>         >     > One blog post I found talks about running "cygrunsrv -I cron -p
>         >     > /usr/sbin/cron -a -D". I just did this, and it reports "The
>         specified
>         >     > service already exists."
>         >     >
>         >     > This is my uname -a output:
>         >     >
>         >     >     CYGWIN_NT-6.1 ... 3.0.3(0.338/5/3) 2019-03-09 19:12 x86_64 Cygwi
>         >     For a more Unix like and self contained Cygwin approach, install
>         syslog-ng, run
>         >     service setup scripts /bin/cygserver-config /bin/syslog-ng-config
>         >     /bin/cron-config, add service dependencies to start up in that
>         order, and you
>         >     should see cron messages in /var/log/syslog if you run elevated:
>         you can also
>         >     run chmod elevated to make /var/log/syslog world readable, or
>         setfacl to add
>         >     user or group read ACLs.
>         > How do I add service dependencies to start up in a particular order?
>         In an elevated cmd or bash shell:
>         elevated > OR # sc config syslog-ng depend= cygserver
>         elevated > OR # sc config cron depend= syslog-ng/cygserver
>         N.B. the "=" is part of each keyword; multiple service dependencies are
>         separated by "/".
>     It's curious that when I bring up the default "Packages" view, filtering for
>     "syslog-ng" doesn't find anything.  I had to switch to the Categories view,
>     and then filtering for that found it.
> After doing all of this, I still can't get cron jobs to work, and I can't get
> any info on why.
> This is the current output from "crontab -l":
> 0       0,12    *       *       *       find /tmp/.logcache/ -type f -mtime +6
> -exec rm {} \;
> 14,15,16,17     *       *       *       *        date >> /home/dk068x/date.txt
> I've tried editing that last one and changing the minutes to include upcoming
> minutes, and then after those minutes, I check the results, and there are none. 
> Nothing in cron.log or syslog-ng.log.

Did you run the <service>-config scripts to setup the services?
Did you restart all services after any changes?

	# for srv in cygserver syslog-ng cron; do \
		for o in -Q -E -Q -S -Q; do \
			cygrunsrv $o $srv; done; done

Check /dev/log:

	# ls -lF --color /dev/log
	srw-rw-rw- 1 SYSTEM SYSTEM 0 Jul 10 12:28 /dev/log=

if you don't see a pink /dev/log with "=" flag, and it's just black with no "="
flag, rm /dev/log and restart syslog-ng as above.

Do not forget to *ALWAYS* shut down all Cygwin services before running setup to
upgrade any Cygwin packages.

You can check the status of all services with a command such as
$ cygrunsrv -VL | sed -Ee '/^Service\s*:\s*/{s//
/;s/\s+$//;s/\s*(\S+)\s+\(Installation\spath\s*:\s*.*\)$/
(\1)/;H;};/^Current\sState\s*:\s*/{s// /;s/\s*$/  /;H;};$!d;${x;s/\n|\s+$|^\s+//g;}'
cron Running   cygserver Running   syslog-ng Running

-- 
Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada

This email may be disturbing to some readers as it contains
too much technical detail. Reader discretion is advised.

--
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

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: How to start and verify cron?
  2019-07-12 15:20           ` Brian Inglis
@ 2019-07-12 16:18             ` David Karr
  2019-07-13  8:26               ` Brian Inglis
  2019-07-13  7:59             ` Henning
  1 sibling, 1 reply; 17+ messages in thread
From: David Karr @ 2019-07-12 16:18 UTC (permalink / raw)
  To: Brian.Inglis, The Cygwin Mailing List

On Fri, Jul 12, 2019 at 8:20 AM Brian Inglis wrote:
>
> On 2019-07-11 15:20, David Karr wrote:
> > On Thu, Jul 11, 2019 at 12:56 PM David Karr wrote:
> >     On Wed, Jul 10, 2019 at 4:04 PM Brian Inglis wrote:
> >         On 2019-07-10 16:15, David Karr wrote:
> >         > On Wed, Jul 10, 2019 at 10:20 AM Brian Inglis wrote:
> >         >     On 2019-07-10 10:55, David Karr wrote:
> >         >     > I've checked the user guide and the FAQ, and I can't find any
> >         information
> >         >     > about how to start cron and verify that it's working.  I found
> >         other blog
> >         >     > posts on other sites, but some of them are old.
> >         >
> >         >     Did you run service setup script /bin/cron-config to set up the
> >         service?
> >         > When I ran that now, it says "Cron is already installed as a service under
> >         > account ...", so I assume that means that I did.
> >         >     > I had installed cron, and I thought it was working, but now I
> >         think that it
> >         >     > is not.  If I edit "~/crontab" and then run "crontab -l", it
> >         lists the
> >         >     > changes I've made to jobs, so at least that is working.  The
> >         real job I
> >         >     > have didn't appear to be doing what it was supposed to be doing,
> >         so I added
> >         >     > a new trivial job that just appends output from "date" to a file
> >         in my
> >         >     > homedir, and after the scheduled time of the job, the file was
> >         not created.
> >         >
> >         >     Messages from cron and other active services should be visible in
> >         the Windows
> >         >     application event log if you have not set up a syslog service.
> >         > I went through it, but I didn't see any indications of issues with
> >         cron.  I'm
> >         > not sure what to look for, or where in the event log interface.
> >         >     > This is the additional job I added:
> >         >     >
> >         >     >     40,42,44 * * * * date >> /home/<myuid>/date.txt
> >         >     >
> >         >     > I did find a "/var/log/cron.log", but it is empty, and the
> >         modtime is from
> >         >     > a few months ago.
> >         >     >
> >         >     > One blog post I found talks about running "cygrunsrv -I cron -p
> >         >     > /usr/sbin/cron -a -D". I just did this, and it reports "The
> >         specified
> >         >     > service already exists."
> >         >     >
> >         >     > This is my uname -a output:
> >         >     >
> >         >     >     CYGWIN_NT-6.1 ... 3.0.3(0.338/5/3) 2019-03-09 19:12 x86_64 Cygwi
> >         >     For a more Unix like and self contained Cygwin approach, install
> >         syslog-ng, run
> >         >     service setup scripts /bin/cygserver-config /bin/syslog-ng-config
> >         >     /bin/cron-config, add service dependencies to start up in that
> >         order, and you
> >         >     should see cron messages in /var/log/syslog if you run elevated:
> >         you can also
> >         >     run chmod elevated to make /var/log/syslog world readable, or
> >         setfacl to add
> >         >     user or group read ACLs.
> >         > How do I add service dependencies to start up in a particular order?
> >         In an elevated cmd or bash shell:
> >         elevated > OR # sc config syslog-ng depend= cygserver
> >         elevated > OR # sc config cron depend= syslog-ng/cygserver
> >         N.B. the "=" is part of each keyword; multiple service dependencies are
> >         separated by "/".
> >     It's curious that when I bring up the default "Packages" view, filtering for
> >     "syslog-ng" doesn't find anything.  I had to switch to the Categories view,
> >     and then filtering for that found it.
> > After doing all of this, I still can't get cron jobs to work, and I can't get
> > any info on why.
> > This is the current output from "crontab -l":
> > 0       0,12    *       *       *       find /tmp/.logcache/ -type f -mtime +6
> > -exec rm {} \;
> > 14,15,16,17     *       *       *       *        date >> /home/dk068x/date.txt
> > I've tried editing that last one and changing the minutes to include upcoming
> > minutes, and then after those minutes, I check the results, and there are none.
> > Nothing in cron.log or syslog-ng.log.
>
> Did you run the <service>-config scripts to setup the services?
> Did you restart all services after any changes?
>
>         # for srv in cygserver syslog-ng cron; do \
>                 for o in -Q -E -Q -S -Q; do \
>                         cygrunsrv $o $srv; done; done
>
> Check /dev/log:
>
>         # ls -lF --color /dev/log
>         srw-rw-rw- 1 SYSTEM SYSTEM 0 Jul 10 12:28 /dev/log=
>
> if you don't see a pink /dev/log with "=" flag, and it's just black with no "="
> flag, rm /dev/log and restart syslog-ng as above.
>
> Do not forget to *ALWAYS* shut down all Cygwin services before running setup to
> upgrade any Cygwin packages.

I assume it would be possible to script this?  How would I do this?

> You can check the status of all services with a command such as
> $ cygrunsrv -VL | sed -Ee '/^Service\s*:\s*/{s//
> /;s/\s+$//;s/\s*(\S+)\s+\(Installation\spath\s*:\s*.*\)$/
> (\1)/;H;};/^Current\sState\s*:\s*/{s// /;s/\s*$/  /;H;};$!d;${x;s/\n|\s+$|^\s+//g;}'
> cron Running   cygserver Running   syslog-ng Running
>
> --
> Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada
>
> This email may be disturbing to some readers as it contains
> too much technical detail. Reader discretion is advised.
>
> --
> 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
>

--
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

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: How to start and verify cron?
  2019-07-12 15:20           ` Brian Inglis
  2019-07-12 16:18             ` David Karr
@ 2019-07-13  7:59             ` Henning
  2019-07-13  8:21               ` Brian Inglis
  1 sibling, 1 reply; 17+ messages in thread
From: Henning @ 2019-07-13  7:59 UTC (permalink / raw)
  To: cygwin

On 12/07/2019 17:20, Brian Inglis wrote:
> Do not forget to *ALWAYS* shut down all Cygwin services before running setup to
> upgrade any Cygwin packages.

Does this mean to also shut down cygserver before running setup?

Henning



--
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

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: How to start and verify cron?
  2019-07-13  7:59             ` Henning
@ 2019-07-13  8:21               ` Brian Inglis
  0 siblings, 0 replies; 17+ messages in thread
From: Brian Inglis @ 2019-07-13  8:21 UTC (permalink / raw)
  To: cygwin


On 2019-07-13 01:59, Henning wrote:
> On 12/07/2019 17:20, Brian Inglis wrote:
>> Do not forget to *ALWAYS* shut down all Cygwin services before running
>> setup to upgrade any Cygwin packages.
> Does this mean to also shut down cygserver before running setup?

Yes - it's linked to cygwin1.dll.

-- 
Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada

This email may be disturbing to some readers as it contains
too much technical detail. Reader discretion is advised.

--
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

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: How to start and verify cron?
  2019-07-12 16:18             ` David Karr
@ 2019-07-13  8:26               ` Brian Inglis
  0 siblings, 0 replies; 17+ messages in thread
From: Brian Inglis @ 2019-07-13  8:26 UTC (permalink / raw)
  To: David Karr, The Cygwin Mailing List


On 2019-07-12 10:18, David Karr wrote:
> On Fri, Jul 12, 2019 at 8:20 AM Brian Inglis wrote:
>> On 2019-07-11 15:20, David Karr wrote:
>>> On Thu, Jul 11, 2019 at 12:56 PM David Karr wrote:
>>>     On Wed, Jul 10, 2019 at 4:04 PM Brian Inglis wrote:
>>>         On 2019-07-10 16:15, David Karr wrote:
>>>         > On Wed, Jul 10, 2019 at 10:20 AM Brian Inglis wrote:
>>>         >     On 2019-07-10 10:55, David Karr wrote:
>>>         >     > I've checked the user guide and the FAQ, and I can't find any
>>>         information
>>>         >     > about how to start cron and verify that it's working.  I found
>>>         other blog
>>>         >     > posts on other sites, but some of them are old.
>>>         >
>>>         >     Did you run service setup script /bin/cron-config to set up the
>>>         service?
>>>         > When I ran that now, it says "Cron is already installed as a service under
>>>         > account ...", so I assume that means that I did.
>>>         >     > I had installed cron, and I thought it was working, but now I
>>>         think that it
>>>         >     > is not.  If I edit "~/crontab" and then run "crontab -l", it
>>>         lists the
>>>         >     > changes I've made to jobs, so at least that is working.  The
>>>         real job I
>>>         >     > have didn't appear to be doing what it was supposed to be doing,
>>>         so I added
>>>         >     > a new trivial job that just appends output from "date" to a file
>>>         in my
>>>         >     > homedir, and after the scheduled time of the job, the file was
>>>         not created.
>>>         >
>>>         >     Messages from cron and other active services should be visible in
>>>         the Windows
>>>         >     application event log if you have not set up a syslog service.
>>>         > I went through it, but I didn't see any indications of issues with
>>>         cron.  I'm
>>>         > not sure what to look for, or where in the event log interface.
>>>         >     > This is the additional job I added:
>>>         >     >
>>>         >     >     40,42,44 * * * * date >> /home/<myuid>/date.txt
>>>         >     >
>>>         >     > I did find a "/var/log/cron.log", but it is empty, and the
>>>         modtime is from
>>>         >     > a few months ago.
>>>         >     >
>>>         >     > One blog post I found talks about running "cygrunsrv -I cron -p
>>>         >     > /usr/sbin/cron -a -D". I just did this, and it reports "The
>>>         specified
>>>         >     > service already exists."
>>>         >     >
>>>         >     > This is my uname -a output:
>>>         >     >
>>>         >     >     CYGWIN_NT-6.1 ... 3.0.3(0.338/5/3) 2019-03-09 19:12 x86_64 Cygwi
>>>         >     For a more Unix like and self contained Cygwin approach, install
>>>         syslog-ng, run
>>>         >     service setup scripts /bin/cygserver-config /bin/syslog-ng-config
>>>         >     /bin/cron-config, add service dependencies to start up in that
>>>         order, and you
>>>         >     should see cron messages in /var/log/syslog if you run elevated:
>>>         you can also
>>>         >     run chmod elevated to make /var/log/syslog world readable, or
>>>         setfacl to add
>>>         >     user or group read ACLs.
>>>         > How do I add service dependencies to start up in a particular order?
>>>         In an elevated cmd or bash shell:
>>>         elevated > OR # sc config syslog-ng depend= cygserver
>>>         elevated > OR # sc config cron depend= syslog-ng/cygserver
>>>         N.B. the "=" is part of each keyword; multiple service dependencies are
>>>         separated by "/".
>>>     It's curious that when I bring up the default "Packages" view, filtering for
>>>     "syslog-ng" doesn't find anything.  I had to switch to the Categories view,
>>>     and then filtering for that found it.
>>> After doing all of this, I still can't get cron jobs to work, and I can't get
>>> any info on why.
>>> This is the current output from "crontab -l":
>>> 0       0,12    *       *       *       find /tmp/.logcache/ -type f -mtime +6
>>> -exec rm {} \;
>>> 14,15,16,17     *       *       *       *        date >> /home/dk068x/date.txt
>>> I've tried editing that last one and changing the minutes to include upcoming
>>> minutes, and then after those minutes, I check the results, and there are none.
>>> Nothing in cron.log or syslog-ng.log.
>> Did you run the <service>-config scripts to setup the services?
>> Did you restart all services after any changes?
>>         # for srv in cygserver syslog-ng cron; do \
>>                 for o in -Q -E -Q -S -Q; do \
>>                         cygrunsrv $o $srv; done; done
>> Check /dev/log:
>>         # ls -lF --color /dev/log
>>         srw-rw-rw- 1 SYSTEM SYSTEM 0 Jul 10 12:28 /dev/log=
>> if you don't see a pink /dev/log with "=" flag, and it's just black with no "="
>> flag, rm /dev/log and restart syslog-ng as above.
>> Do not forget to *ALWAYS* shut down all Cygwin services before running setup to
>> upgrade any Cygwin packages.
> I assume it would be possible to script this?  How would I do this?

	# cygrunsrv -L | xargs -n1 cygrunsrv -E
OR
	# for o in -Q -E -Q; do \
		for srv in cygserver syslog-ng cron; do \
			cygrunsrv $o $srv; \
		done; \
	done

>> You can check the status of all services with a command such as
>> $ cygrunsrv -VL | sed -Ee '/^Service\s*:\s*/{s//
>> /;s/\s+$//;s/\s*(\S+)\s+\(Installation\spath\s*:\s*.*\)$/
>> (\1)/;H;};/^Current\sState\s*:\s*/{s// /;s/\s*$/  /;H;};$!d;${x;s/\n|\s+$|^\s+//g;}'
>> cron Running   cygserver Running   syslog-ng Running

-- 
Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada

This email may be disturbing to some readers as it contains
too much technical detail. Reader discretion is advised.

--
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

^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2019-07-13  8:26 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-10 16:55 How to start and verify cron? David Karr
2019-07-10 17:19 ` Brian Inglis
2019-07-10 22:15   ` David Karr
2019-07-10 23:04     ` Brian Inglis
2019-07-11 19:57       ` David Karr
2019-07-11 20:12         ` Vince Rice
2019-07-11 20:23           ` Vince Rice
2019-07-11 21:18             ` David Karr
2019-07-11 21:52               ` Vince Rice
2019-07-11 21:20         ` David Karr
2019-07-11 22:57           ` René Berber
2019-07-11 23:21             ` René Berber
2019-07-12 15:20           ` Brian Inglis
2019-07-12 16:18             ` David Karr
2019-07-13  8:26               ` Brian Inglis
2019-07-13  7:59             ` Henning
2019-07-13  8:21               ` Brian Inglis

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).