Re: FTP delete problem



But i have wrote that manually the delete command it's OK!!!

My problem is in the scheduled phase, when nobody is logged on the server


"Bernard Cheah [MVP]" <qbernard@xxxxxxxxxxxxxxxxxxx> ha scritto nel
messaggio news:OWjS30ipGHA.4760@xxxxxxxxxxxxxxxxxxxxxxx
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.












.



Relevant Pages

  • Re: FTP in ASP.NET C#
    ... It has native .NET classes that will allow you to use the FTP protocol. ... >I would like to have my application FTP a file to a server after a user ... > ' This script assumes the file to be FTP'ed is in the same directory as ... > ' If there are multiple files to put, we need to use the command ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: replace field contents - record locking
    ... (windows, server 8, clients 8.5) ... If a user is in a record, then it is locked, and the replace command ... You can script navigation to force a record commit. ... successive editions of Filemaker have been successively slower. ...
    (comp.databases.filemaker)
  • Re: Perl and IIS - script runs but The page cannot be displayed
    ... > one with the variables passed to the script hard coded (although there ... > with absolute paths rather the relative ones the server doesnt mind. ... When executed from a command line, ... CGI programs do not use this function, ...
    (comp.lang.perl.misc)
  • Re: DNS Management tools for Large hosting environment
    ... like things simple without having to script something (seeing as I have never ... nowhere do I see a command to SEARCH for a host record and REPLACE ... Server in multiple domains. ... >> manualy, thus my need for a global search and replace, which it appears, ...
    (microsoft.public.windows.server.active_directory)
  • Re: dcdiag - advertising errors on newley promoted domain controller
    ... Can you do the following on uksccmads01 ... The problem may actually have nothing to do with the new server but the ... From a command prompt try and see if you get any additional info ... Skipping site UK-CCM, this site is outside the scope ...
    (microsoft.public.windows.server.active_directory)