du -ks output different when run from command and when run on scheduled task

Larry Hall (Cygwin) reply-to-list-only-lh@cygwin.com
Tue Dec 7 22:21:00 GMT 2010


On 12/7/2010 4:10 PM, computer tech wrote:
> Greetings all I have run this set of commands directly from the cygwin
> command line.
> du -ks //comp/shares/
>
> Ouput1: is correct
> 49939594	//comp/shares/

<snip>

> The bat. file that schedules the bash script looks like this.  The
> scheduled task runs at night and it works , it just outputs the wrong
> number.
> @echo off
> C:\cygwin\bin\bash.exe --login -c "/home/rod/Shop-fs2.sh"
>
> Output2: when script runs from scheduled tasks ; It just gives a 4,
> when the output is way more then 4.
> 4	//s550-shop/shares/replica/Administration

Yep.  This is an age-old issue that really has to do with Windows permissions
for services.  The default user for services doesn't have permission to
access network shares, even if you do.  One option is to run the service
as you.  There are others.  Read

<http://cygwin.com/cygwin-ug-net/ntsec.html#ntsec-setuid-overview>

and the following sections for more background, details, and possible
options.

-- 
Larry Hall                              http://www.rfk.com
RFK Partners, Inc.                      (508) 893-9779 - RFK Office
216 Dalton Rd.                          (508) 893-9889 - FAX
Holliston, MA 01746

_____________________________________________________________________

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



More information about the Cygwin mailing list