Hi Brian: Thank you for your response. On 23/05/2023 17:44, Brian Inglis wrote: > On 2023-05-23 13:46, Jonathan Clark via Cygwin wrote: >> First off, many thanks to everyone who is putting in time and effort in making cygwin as wonderful as it is. >> >> I'm trying to get what I think is a simple cron job working. So far all I've gotten is frustrated and confused. I'm sure I'm doing something stupid (probably more than one thing), but I don't know what. At this point I have tried many different twiddles and fiddles and so on, with no positive results. Any help gratefully accepted. >> >> I am familiar with cron and crontabs on various flavours of UNIX, but this is my first attempt at getting a cron job working on cygwin. >> >> I have DLed the cron package and gotten it running (possibly wrongly...). >> >> There are no cron.allow nor cron.deny files that I can find. >> >> I have set up a crontab which looks correct to me. I have tried many variants of the actual command - adding a specific shell invocation (having read somewhere that this needs to be a .exe file). The target script works just fine when invoked by hand. I have ensured that the crontab file is written in UNIX format. I have messed around with file permissions so that the target script is not writable, even by me. >> >> However, nothing works. Either: >> >> a) nothing is ever invoked - cronevents shows that the new crontab is loaded, but there's nothing there which shows that the specified command is ever run; >> >> OR >> >> b) I get a gnomic message about the crontab being UNSAFE. >> >> I have a sneaking suspicion that the space in my Windows username may be the cause of the UNSAFE. >> >> Along the way I have fallen over various other curiosities. >> >> 'crontab -u' just says "must be privileged", even though I'm running it from an Administrator account. >> >> cron-config talks about using 'passwd -R'  as an option, but when I try this all I get is: >> "Storing password failed: Function not implemented" which is unhelpful. >> >> Apart from exhaustive search, there doesn't seem to be any way to search the cygwin mailing list archives - is there such a facility hidden somewhere? >> >> Any help appreciated! cronbug.txt attached > > Hi JC, > > You do not appear to be running cron! You are right! Or at you *were* right - at the time I ran cronbug, cron must have died, or I accidentally killed it, or something. I did mention that I had gotten confused :-) Anyway, it's clear from the logfiles that it *has* been running in the past. Attached is a newly generated cronbug output which should be accurate. > Did you set up by running `/usr/sbin/cron-config` from an elevated admin shell and starting with the default answers? Yes, exactly that. > I would avoid trying `crontab -u USER` under Cygwin as ideas of admin don't match. Indeed so. I am happy to avoid that one. > I or config script created empty /var/cron/cron.deny to allow all users (me) to use cron. I tried both ways - with and without cron.deny. I have the same (failing) result either way (which is exactly what I would expect). > I started off using `crontab -e` and `crontab -l > ~/$USER.crontab` to update and save, but now just edit ~/$USER.crontab then `crontab ~/$USER.crontab` to reload. I use 'crontab -e' out of habit, but the effect should be the same. > and never try running anything but non-elevated Cygwin scripts and commands. Same thing here - no elevated scripts. Anyway, I put in the absolute simplest cron job I could think of: * * * * * /bin/echo Hello This fails reliably with the UNSAFE log entry: 2023/05/23 18:19:01 [Jonathan Clark] /usr/sbin/cron: PID 2627: (Jonathan Clark) CMD (/bin/echo Hello) 2023/05/23 18:19:01 [Jonathan Clark] /usr/sbin/cron: PID 2626: (Jonathan Clark) UNSAFE (Jonathan Clark) So I'm still completely stuck. I did notice one oddity while messing around with the above. The test job goes off every minute, at zero seconds. However, at least according to cronevents, it takes an entire minute for cron to change to a new crontab. IE the sequence is: 1) update crontab 2) zero seconds reached, *old* cron job executed 3) 60 seconds pass, only now is *new* cron job executed. Here's the terminal screendump, while running 'crontab -e' I merely changed the command from "/bin/echo Hello" to "/bin/echo Hello There". -- w10$ crontab -e crontab: installing new crontab w10$ date Tue, May 23, 2023 6:27:47 PM w10$ sleep 15; cronevents | tail -5 2023/05/23 18:27:43 [Jonathan Clark] crontab: PID 2648: (Jonathan Clark) REPLACE (Jonathan Clark) 2023/05/23 18:27:43 [Jonathan Clark] crontab: PID 2648: (Jonathan Clark) END EDIT (Jonathan Clark) 2023/05/23 18:28:01 [Jonathan Clark] /usr/sbin/cron: PID 2554: (Jonathan Clark) RELOAD (tabs/Jonathan Clark) 2023/05/23 18:28:01 [Jonathan Clark] /usr/sbin/cron: PID 2652: (Jonathan Clark) CMD (/bin/echo Hello) 2023/05/23 18:28:01 [Jonathan Clark] /usr/sbin/cron: PID 2651: (Jonathan Clark) UNSAFE (Jonathan Clark) w10$ sleep 60; cronevents | tail -5 2023/05/23 18:28:01 [Jonathan Clark] /usr/sbin/cron: PID 2554: (Jonathan Clark) RELOAD (tabs/Jonathan Clark) 2023/05/23 18:28:01 [Jonathan Clark] /usr/sbin/cron: PID 2652: (Jonathan Clark) CMD (/bin/echo Hello) 2023/05/23 18:28:01 [Jonathan Clark] /usr/sbin/cron: PID 2651: (Jonathan Clark) UNSAFE (Jonathan Clark) 2023/05/23 18:29:01 [Jonathan Clark] /usr/sbin/cron: PID 2656: (Jonathan Clark) CMD (/bin/echo "Hello There") 2023/05/23 18:29:01 [Jonathan Clark] /usr/sbin/cron: PID 2655: (Jonathan Clark) UNSAFE (Jonathan Clark) -- This only confused me for a little while, fortunately. I assume this behaviour is buried in the original Vixie code, and I don't really care. However, I would still like to run my cron jobs. Is there any hope? I *still* think that this is connected to having a space in my Windows username, but surely I cannot be the only person out there doing this... I found this issue on the Red Hat bug list: https://bugzilla.redhat.com/show_bug.cgi?id=147636 but that's from 2005! Jonathan