This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: Perl script called by windows batch file in Scheduled task can't find mount or windows share
- From: Andrew DeFaria <Andrew at DeFaria dot com>
- To: cygwin at cygwin dot com
- Date: Sun, 19 Feb 2006 08:33:29 -0800
- Subject: Re: Perl script called by windows batch file in Scheduled task can't find mount or windows share
- References: <20060219094158.15236.qmail@web81508.mail.mud.yahoo.com>
Indra Gunawan wrote:
Although I've found many issues related to "mount" I've yet to find
the answer to my current problem. So, I hope I can find the answer
from my posting now.
Anyway, I would like to copy the software installer exe file to a n
ftproot folder on another windows machine as part of software build
process for download. The build process itself is automated in a perl
script under cygwin environment called by batch file executed as
Windows Scheduled Task.
It's executed in batch file like this: c:\tools\cygwin\bin\bash
--login -c 'source /temp/machenv;time
c:/scripts/batch/NightlyBuild/build.pl' > logs/bld.log 2>&1
I've made sure that I mapped the ftproot folder as UNC path using the
local administrator of the ftp hosting
machine first:
net use \\<Machine_Name>\C$\Inetpub\ftproot <password>
/user:administrator /persistent:yes
and in cygwin bash shell I did this: mount
\\\\<Machine_Name>\\C$\\Inetpub\\ftproot /ftproot -s -E
All are fine. However, the test for existence of this folder /ftproot
fails, thus the copy does not work in
the build script as executed by batch file in Scheduled Task.
However, if I launch Windows shell and run the batch file, the build
script works and the copy is successful.
I created a new scheduled task to execute simple batch file which
calls a perl script to debug/find out about the "mount" command in
cygwin. This mount point /ftproot is still available but the script
issuing "cd /ftproot" and "ls" both fail.
cd: can't cd to /ftproot
ls: /ftproot: No such file or directory
However, again running it in Windows shell the "cd /ftproot" and "ls"
work.
Is the issue with the bash, or the Windows Scheduled Task or some
issue with mounting UNC share?
Why all this additional complication of using bat files and Windows
Scheduled Tasks and Perl scripts, etc.? If you are scheduling something
then use cron. If you wish to reach out over a UNC path then
//<server>/<share>/<path>/</file> should work fine. And if you are
getting something via ftp use ncftpget.
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/