On Sun, Mar 21, 2010 at 6:10 PM, computer tech wrote: > I have a .bat file, that is scheduled to run as NT Authority\System > every morning. The schedule tasks calls the run.bat file. The script > is running at the schedule time, but when I check the files in the > morning the only output is from the 'echo' commands(see hello-fs2.sh > script below). I don't see any of the output from the 'du' and 'find' > commands(see hello-fs2.sh script below). When I manually run the > script from the cygwin command line it works properly as intended. The > machine is running WinXP SP 3 with A pentium 4 processor(3.0ghz). > > ---- file run.bat > @echo off > C:\cygwin\bin\bash.exe --login -c "/home/bob/hello-fs2.sh" > ---- > ---- file hello-fs2.sh > #!/usr/bin/bash > DIR=//device01/shares/replica/ > OUT=/cygdrive/c/logs > echo `date` >> $OUT/Avondale-foldersize.txt > du -k --max-depth=1 $DIR | sort -nr >> $OUT/foldersize.txt
Try capturing stderr too, it may provide a hint. Something like: du -k --max-depth=1 $DIR 2>>$OUT/du.err | sort -nr >> $OUT/foldersize.txt > echo `date` >> $OUT/Changedfile.txt > find $DIR -type f -mtime -1 -print >> $OUT/Changedfile.txt find $DIR -type f -mtime -1 -print >> $OUT/Changedfile.txt 2>>$OUT/find.err > echo "---- done --- " >> $OUT/Changedfile.txt > ---- Maybe SYSTEM doesn't have permission to read //device01/shares/replica/ or write c:\logs -- Life is complex, with real and imaginary parts -- 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