delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2019/07/12/12:19:27

X-Recipient: archive-cygwin AT delorie DOT com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:mime-version:references:in-reply-to:from:date
:message-id:subject:to:content-type; q=dns; s=default; b=UjRaR0Q
mTPZ6UXIjsfaT/O1GDr699PriNiA9cX0cYreeElrzhBnYhQEy62QD2E8nv7l3GOL
Lz8uizHco8Gywdtgceu1FLMbkuGkJGQgDy/CiEeLiJsk2TRe8yreD7URFjgQ708a
JOe4IN3kjiDMxPsJ373f7UP9uYHwGvRgCeNA=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:mime-version:references:in-reply-to:from:date
:message-id:subject:to:content-type; s=default; bh=Zim/cFfBkwgo9
5RJ2Dgo0uAzMXM=; b=uRvjmXE9NXELACoOmgc+W6pnQ+iLuxQSLd/A7qxNoRyUV
Vlot/F5WUk/0HlMeQNf83Bj1wlNm9P++5PJlkzzmVxTqJaS8AOXWyRau8TdjMAOU
lGsG2EPRHNlbBFsAA6ddnU6+rSflVHzlBbx63uNXwNU3D/W08t+kuWmNWEMVv0=
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Authentication-Results: sourceware.org; auth=none
X-Spam-SWARE-Status: No, score=-0.8 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.1 spammy=
X-HELO: mail-ed1-f43.google.com
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=yq5vXCGP6qISL4/hkRvOHFW8zqojL6dO5iYjwFrsaPg=; b=hJgNgX1b6jJY9XELdk1xudA5URIcnVi+JrHWXNUHOiPkAHwdkdAvuQsbc1gS6jLrjN 4x0LJ8w8+edlP7ly0i/GDDiGK9cgcr7icd587W71DRXPqYPS4vU9ThuPPiEVK/VtUcu4 PuuPnkgHau1AcDdFu+u09Go8S9d/ICMWxyf2suMuQyaE6zXr1aUUVebr4dm1kCSOaeat cvk7vltAPyhIykSsdJmA39Cn8z5dF5NgULpBjxETrBVhFAijaEzwtGKCRmPy/PxJWxnr voAT1h3B8i0CVIuIwYm+W/GLrl3rCSAtltYbRX06amGG8TcDJJ+Ycgti1Stn6yzVK2lD vs/g==
MIME-Version: 1.0
References: <CAA5t8Vq5+4dizayQUDG_=jx_i=ZgCTjo6-q567nhge77eS--CQ AT mail DOT gmail DOT com> <61a6773b-5fe9-62e0-78ec-7684ee0d04b0 AT SystematicSw DOT ab DOT ca> <CAA5t8VpPvvt3c+CZHpSVrj_XAdJrTVCfq6Wd0mSBKhZpqv8Csg AT mail DOT gmail DOT com> <74357359-436a-0ead-f7bc-b288572d6cc3 AT SystematicSw DOT ab DOT ca> <CAA5t8Vqi0R07WV5W_o_uhLbhkr2B0RU=UfjGEOh9ps4aeSE+WA AT mail DOT gmail DOT com> <CAA5t8Vpc=wGAap-K-J-qxn54_1EXPKgUdO2mvo1w8V5mKjm1ZA AT mail DOT gmail DOT com> <7af86f7a-5a51-6280-2f96-8caa3603211e AT SystematicSw DOT ab DOT ca>
In-Reply-To: <7af86f7a-5a51-6280-2f96-8caa3603211e@SystematicSw.ab.ca>
From: David Karr <davidmichaelkarr AT gmail DOT com>
Date: Fri, 12 Jul 2019 09:18:12 -0700
Message-ID: <CAA5t8Vq+oQXzwPYn-Z=VCWshz2LQkxJb7O0BW5tc1h53Q3NGGA@mail.gmail.com>
Subject: Re: How to start and verify cron?
To: Brian DOT Inglis AT systematicsw DOT ab DOT ca,
The Cygwin Mailing List <cygwin AT cygwin DOT com>
X-IsSubscribed: yes

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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019