Re: FTP delete problem
- From: "Bernard Cheah [MVP]" <qbernard@xxxxxxxxxxxxxxxxxxx>
- Date: Thu, 27 Jul 2006 13:53:41 +0800
OMG....... so you are trying to delete the 'open' log file.
i thought the script is looking for previous day 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:1153916251.965327.311950@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
I have resolved.
the problem was a lock to a file that the ftp get worked, but the ftp
delete did not work.
I get the iis log files in a hour (1:00 AM) when my UTC time zone is
GMT+1 (Rome)
(+1 standard time) = GMT+2.
I had forgotten the flag on the IIS server for the local time zone.
Therefore the log file is locked by iis process.
After to have postponed the scheduled job the problem is disappeared.
Best Regards
FABIO
Bernard Cheah [MVP] ha scritto:
You mentioned that it logon and download the file. so how would local
policies block it. unless it's not able to login at all.
how come you unable to generate the output from schedule tasks?
--
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:eaGQ7GjqGHA.2180@xxxxxxxxxxxxxxxxxxxxxxx
Nothing to do, i try another time this output, but nothing, the file
isn't
generate by schedule task.
I think to local policies in case of no session logon, but i don't know
the new security of win2003.
Can you help me?
"Bernard Cheah [MVP]" <qbernard@xxxxxxxxxxxxxxxxxxx> ha scritto nel
messaggio news:e28VimLqGHA.988@xxxxxxxxxxxxxxxxxxxxxxx
You can't capture the output for the schedule task?
Return = objShell.Run("ftp -s:" & Chr(34) & strFTPScriptFileName &
chr(34) & " > output.txt" ,1,true)
--
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:%23kLmJQAqGHA.3584@xxxxxxxxxxxxxxxxxxxxxxx
The Output
*****************************
ftp> Connected to 10.10.20.50.
open 10.10.20.50
220 Microsoft FTP Service
User (10.10.20.50:(none)):
331 Password required for webnascar.
230 User webnascar logged in.
ftp> cd w3svc1424786450
250 CWD command successful.
ftp> ascii
200 Type set to A.
ftp> Local directory now D:\logfiles\mydir
ftp> lcd d:\logfiles\mydir
get ex060714.log
200 PORT command successful.
150 Opening ASCII mode data connection for ex060714.log(5238066464
bytes).
226 Transfer complete.
ftp: 5238066464 bytes received in 495,63Seconds 10568,61Kbytes/sec.
ftp> delete ex060714.log
250 DELE command successful.
ftp> bye
221
****************************************
If i manually execute the script, the output wrote, but by schedule
isn't create the output and the delete
command don't success.
The scheduled task script i configure by admin rights, and the ftp
user
have the user right (Read/Write/Modify/Delete) , i think that in
windows
2003 the security is + complex that i know.
"Bernard Cheah [MVP]" <qbernard@xxxxxxxxxxxxxxxxxxx> ha scritto nel
messaggio news:ukQSjFmpGHA.1548@xxxxxxxxxxxxxxxxxxxxxxx
I know. the task scheduler need permission to fire up the tasks.
Whereas the ftp script - the logon user need to have permissions on
the
ftp.
If it's works on manually it should work in the scheduled tasks.
I just like to capture the output during manual running the
ftp -s:bla
bla
output1.txtand inside the scheduel tasks... to see if we can find out anything.
--
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:O7axEakpGHA.1600@xxxxxxxxxxxxxxxxxxxxxxx
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.
.
- Follow-Ups:
- Re: FTP delete problem
- From: Fabio
- Re: FTP delete problem
- References:
- Re: FTP delete problem
- From: fabio
- Re: FTP delete problem
- From: Bernard Cheah [MVP]
- Re: FTP delete problem
- From: Fabio
- Re: FTP delete problem
- Prev by Date: Re: Problem with Home Directory for FTP site.
- Next by Date: Re: FTP delete problem
- Previous by thread: Re: FTP delete problem
- Next by thread: Re: FTP delete problem
- Index(es):
Relevant Pages
|