This is the mail archive of the
cygwin
mailing list for the Cygwin project.
du -ks output different when run from command and when run on scheduled task
- From: computer tech <comphandyman at gmail dot com>
- To: cygwin at cygwin dot com
- Date: Tue, 7 Dec 2010 14:10:48 -0700
- Subject: du -ks output different when run from command and when run on scheduled task
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/
When I put the script in a bash script(file1.sh) and run from cygwin
command line, it works fine also(output1 is generated), it is only
when the file runs as a schedule task that if gives the wrong
ouput(output2)
For clarity sake here is what the file looks like.
#!/usr/bin/bash
OUT=/cygdrive/c/logs
echo `date` >> $OUT/size-new.txt
du -ks //comp/shares/ >> $OUT/size-new.txt
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
I am running win xp, sp3. And I am really confused. Why would script
generate proper output when it is run from command line and not when
run from scheduled tasks.
Thank you all for your help,
Rigo
--
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