Re: FTP delete problem
- From: "Bernard Cheah [MVP]" <qbernard@xxxxxxxxxxxxxxxxxxx>
- Date: Thu, 13 Jul 2006 11:34:13 +0800
Ok, you are create the scripts file dynamically.
Can you manually run the script file?
ftp -s:ftpscript.txt
post the output here or you can redirect the output to > abc.txt.
--
Regards,
Bernard Cheah
http://www.iis.net/
http://www.iis-resources.com/
http://msmvps.com/blogs/bernard/
"fabio" <fabio.cecaro@xxxxxxxxxxx> wrote in message
news:ubIrWNXpGHA.3584@xxxxxxxxxxxxxxxxxxxxxxx
Here's my code scheduled every day
***********************************
Option Explicit
Dim objFSO, objMyFile, objShell,FileLog
Dim anno, mese,meseN, giorno,Return
Dim d1,strFTPScriptFileName, strFile2Get
Dim strLocalFolderName, strFTPServerName, strLoginID
Dim strPassword, strFTPServerFolder
d1=dateadd("d",-1,date)
anno=Right(year(d1),2)
mese=Trim(month(d1))
if len(mese)<=1 Then
mese="0"&mese
end If
giorno=day(d1)
if len(giorno)<=1 Then
giorno="0"&giorno
end If
FileLog = Trim("ex"&anno&mese&giorno&".log")
strLocalFolderName = "d:\logfiles"
strFTPServerName = "10.10.20.50"
strLoginID = "mylogin"
strPassword = "mypassword"
strFTPServerFolder = "W3SVC1095794977"
Set objFSO = CreateObject("Scripting.FileSystemObject")
strFTPScriptFileName = "C:\Inetpub\wwwroot\stat\FTPScript.txt"
Set objMyFile = objFSO.CreateTextFile(strFTPScriptFileName, True)
objMyFile.WriteLine ("open " & strFTPServerName)
objMyFile.WriteLine (strLoginID)
objMyFile.WriteLine (strPassword)
objMyFile.WriteLine ("cd " & strFTPServerFolder)
objMyFile.WriteLine ("ascii")
objMyFile.WriteLine ("lcd " & strLocalFolderName)
objMyFile.WriteLine ("get " & FileLog)
objMyFile.WriteLine ("delete " & FileLog & " > c:\output.txt")
objMyFile.WriteLine ("bye")
objMyFile.Close
Set objMyFile = Nothing
Set objShell = WScript.CreateObject( "WScript.Shell" )
Return = objShell.Run("ftp -s:" & Chr(34) & strFTPScriptFileName & chr(34)
,1,true)
Set objFSO = Nothing
*******************************************************
I have modified the row with delete command, but it's don't write any
files.
"Fabio" <fabio.cecaro@xxxxxxxxxxx> ha scritto nel messaggio
news:1152542159.812868.38700@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
The verbose mode is always on.
I test the output ">" to file, but nothing.
In my script I use the options -s for the file.
The options -d (debugging), how it works?
Bernard Cheah [MVP] ha scritto:
look at the ftp command, turn on verbose mode
then redirect the output to a text file via the '>' method
e.g. c:\>dir *.* > output.txt
--
Regards,
Bernard Cheah
http://www.iis.net/
http://www.iis-resources.com/
http://msmvps.com/blogs/bernard/
"fabio" <fabio.cecaro@xxxxxxxxxxx> wrote in message
news:%23G6x1t%23oGHA.1440@xxxxxxxxxxxxxxxxxxxxxxx
How i can save the output of FTP command?
If i am in session in the server the scheduled script result OK.
But in automated state scheduled the files that i get don't delete.
In my script i make a txt file with a sequence of command :
logon,lcd,get and delete, by wscript.shell.run
In this mode i try to print the output in the other files, but nothing
to
do.
I don't know the error,
the ftp command save the status in temp files that i don't know?
Thanks
"Bernard Cheah [MVP]" <qbernard@xxxxxxxxxxxxxxxxxxx> ha scritto nel
messaggio news:eVTV918oGHA.3288@xxxxxxxxxxxxxxxxxxxxxxx
Strange indeed. was it error 550 in the status code?
Sound like ftp cache issue to me, but it works in manual mode :(
is it always failed to delete the log?
--
Regards,
Bernard Cheah
http://www.iis.net/
http://www.iis-resources.com/
http://msmvps.com/blogs/bernard/
"fabio" <fabio.cecaro@xxxxxxxxxxx> wrote in message
news:OZ7S6ZloGHA.4912@xxxxxxxxxxxxxxxxxxxxxxx
I have made a script in server A that make ftp connection to server
B,
Get a file and Delete it after.
Well, in this script i have insert username,password of local
account of
server B
that have read/write/delete access in the directory that i need.
This script is scheduled every day (i download the day before IIS
logfile to another server)
and it Get without problem, but don't Delete log file, strangely if
i
run manually this script,
the Delete problem have resolved.
There is problem in windows 2003 ftp server or in the credentials of
script scheduled?
Please Help Me.
.
- Follow-Ups:
- Re: FTP delete problem
- From: fabio
- Re: FTP delete problem
- References:
- FTP delete problem
- From: fabio
- Re: FTP delete problem
- From: Bernard Cheah [MVP]
- Re: FTP delete problem
- From: fabio
- Re: FTP delete problem
- From: Bernard Cheah [MVP]
- Re: FTP delete problem
- From: Fabio
- Re: FTP delete problem
- From: fabio
- FTP delete problem
- Prev by Date: Re: "Parameter is Incorrect"
- Next by Date: Re: Folder modification date not changing
- Previous by thread: Re: FTP delete problem
- Next by thread: Re: FTP delete problem
- Index(es):
Relevant Pages
|
Loading