Topic "Can't delete file on FTP host"

Author Message
byteguy
[View user's profile]

Joined: 2010-04-06
Posts: 1
Trying to call WinSCP in pure command-line mode to replace Windows FTP in an old system that needs to run with passive FTP now.

I've got it working for sending, receiving, and listing files. But I just can't get it deleting on the host.

I write a script file and then fire off WinSCP with:

winscp /script=tempftp.scr /log="null.txt"

First tried "RM" like this:

option echo off
option confirm off
open ftp://user:password@host.com -passive
cd database
rm marker.txt
close
exit

The file was left and the log showed

. 2010-04-05 23:19:39.680 Getting current directory name.
. 2010-04-05 23:19:39.680 Deleting file "marker.txt".
> 2010-04-05 23:19:39.680 DELE /database/marker.txt
< 2010-04-05 23:19:39.711 450 Deletion failed
. 2010-04-05 23:19:39.711 Asking user:
. 2010-04-05 23:19:39.711 Error deleting file 'marker.txt'.("Deletion failed")

Then tried a "get -delete" (renamed on download side to avoid collision since I intend to delete, confirm with LS and then send updated file)

option echo off
option confirm off
open ftp://user:password@host.com -passive
cd database
get -delete marker.txt null.fil
close
exit

This got the file, saved it with the new name, but didn't delete. The log showed:

. 2010-04-05 23:05:44.820 Deleting file "/database/marker.txt".
> 2010-04-05 23:05:44.820 DELE /database/marker.txt
< 2010-04-05 23:05:44.852 450 Deletion failed
. 2010-04-05 23:05:44.852 Asking user:
. 2010-04-05 23:05:44.852 Error deleting file '/database/marker.txt'. ("Deletion failed")

What am I missing here?
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25034
Location: Prague, Czechia
What version of WinSCP are you using?
_________________
Martin Prikryl
Advertisements

You can post new topics in this forum






Search Site

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License