This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Windows 7, cron, permissions
- From: Guy Harrison <swampdog at ntlworld dot com>
- To: cygwin at cygwin dot com
- Date: Mon, 28 May 2012 15:11:12 +0100
- Subject: Windows 7, cron, permissions
Hi Folks,
The actual fault lies in 'cj-defrag' where 'cjx' mails the output
of 'cj-defrag'. 'cj-defrag' calls a child script 'sd-defrag' and
all 'sd-defrag' does is call "df.exe". The single line at the bottom
simplifies the problem: do a quick defrag of the E: drive.
The other issue was $TMP being set to somewhere unwritable. This is a work
machine so I'm assuming it's some daft policy setting. Setting TMP
to "/tmp" fixed that.
$ crontab -l
<crontab -l>
# DO NOT EDIT THIS FILE - edit the master and reinstall.
# (/tmp/crontab.Uu0sojHu8c installed on Mon May 28 14:46:36 2012)
# (Cron version V5.0 -- $Id: crontab.c,v 1.12 2004/01/23 18:56:42 vixie Exp
$)
PATH="$HOME/bin:/usr/local/sd/bin:/usr/local/bin:/usr/bin:/bin"
TMP="/tmp"
#------------------------------------------------------------------------------
#min hrs dom mon dow cj exe args
#------------------------------------------------------------------------------
##20 12 * * * cjx cj-my-backup
##29 12 * * * cjx cj-df
##30 12 * * * cjx cj-updatedb
##40 12 * * * cjx cj-defrag
##01 */4 * * * cjx chk-au
#------------------------------------------------------------------------------
* * * * * /cygdrive/c/Program\ Files/Defraggler/df.exe E: /QD
</crontab -l>
$ cd&& cat cron.log
<cron.log>
This file was written by the /usr/bin/cronlog script on 20120528_144702
From: root (Cron Daemon)
To: zrgh1
Subject: Cron <zrgh1@C-0029-1742117> /cygdrive/c/Program\
Files/Defraggler/df.ex
e E: /QD
X-Cron-Env: <ALLUSERSPROFILE=C:\ProgramData>
X-Cron-Env: <COMMONPROGRAMFILES=C:\Program Files (x86)\Common Files>
X-Cron-Env: <COMPUTERNAME=C-0029-1742117>
X-Cron-Env: <COMSPEC=C:\Windows\system32\cmd.exe>
X-Cron-Env: <CYGWIN=ntsec>
X-Cron-Env: <NUMBER_OF_PROCESSORS=4>
X-Cron-Env: <OS=Windows_NT>
X-Cron-Env: <PATH=$HOME/bin:/usr/local/sd/bin:/usr/local/bin:/usr/bin:/bin>
X-Cron-Env: <PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC>
X-Cron-Env: <PROCESSOR_ARCHITECTURE=x86>
X-Cron-Env: <PROCESSOR_IDENTIFIER=Intel64 Family 6 Model 42 Stepping 7,
GenuineIntel>
X-Cron-Env: <PROCESSOR_LEVEL=6>
X-Cron-Env: <PROCESSOR_REVISION=2a07>
X-Cron-Env: <PROGRAMFILES=C:\Program Files (x86)>
X-Cron-Env: <SYSTEMDRIVE=C:>
X-Cron-Env: <SYSTEMROOT=C:\Windows>
X-Cron-Env: <TMP=/tmp>
X-Cron-Env: <TEMP=/cygdrive/c/Users/CYG_SE~1/AppData/Local/Temp>
X-Cron-Env: <WINDIR=C:\Windows>
X-Cron-Env: <SHELL=/bin/sh>
X-Cron-Env: <HOME=/home/zrgh1>
X-Cron-Env: <LOGNAME=zrgh1>
<**>
Access Denied. Administrator permissions are needed to use the selected
options. Use an administrator command prompt to complete these tasks.
</**>
</cron.log>
User "cyg_server" is a member of "Administrators" and UAC is disabled. I
have checked the "Run this program as an administrator" option(*) on the
shortcut (compatibility tab) to the desktop mintty terminal before
running 'cron-config'.
(*) Ditto for "setup.exe". Created a shortcut to that and always run as
administrator.
When I run..
"/cygdrive/c/Program\ Files/Defraggler/df.exe E: /QD"
..from the mintty command line all is well.
It appears (**) the cron daemon is not getting privileges to run "df.exe"
but I am stumped on how to proceed.
TIA
Guy
--
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