Operating System - OpenVMS
1752767 Members
5003 Online
108789 Solutions
New Discussion юеВ

Re: How to delete files from FTP site

 
SOLVED
Go to solution
John T. Farmer
Regular Advisor

How to delete files from FTP site

After a recent upgrade to VMS 8.3, I began experimenting with COPY/FTP for moving files between our two Alpha servers. Is there a simple way, besides using FTP script, to delete a file from an ftp server, either VMS or Windows? COPY/FTP for transfering files is preferred because I think it provides better error checking capability for DCL scripting. However, many times we want to move a file (copy & delete the source).

Thanks for your input,

John (john dot farmer at genworth dot com)
10 REPLIES 10
Steven Schweda
Honored Contributor

Re: How to delete files from FTP site

Sounds as if you want RENAME /FTP.

I did add a remote-delete-after-fetch option
to wget for a user once (classy user
interface: "if (getenv( "WGET_FTP_DELETE") !=
NULL)"), but it's not in any released kit.
Let me know if you're that desperate for a
good time, and I can put the files somewhere.
Hoff
Honored Contributor
Solution

Re: How to delete files from FTP site

I'd asked the HP TCP/IP Services team about DELETE /FTP, it's one of various obvious omissions from the available commands. The lack of RENAME /FTP being another. (I hope they're working on it, as well as on COPY /SFTP and friends.)

DELETE /FTP is available under Process Multinet. Here's an OpenVMS Alpha V8.3 box running Multinet:

$ delete/ftp 10.254.254.254::file.bogus
10.254.254.254: %MULTINET-F-EHOSTUNREACH, No route to host
$

With the HP TCP/IP Services, the existing rexec, rsh and ssh mechanisms are all potential options here. (In general, sftp is both far better and far safer than ftp, particularly on an open IP network.)


If the remote FTP server can run DECnet-Plus, you can configure and use DECnet over IP.

FWIW, the command COPY /FTP has been around since V6.2. It's not new with V8.3.

Bill Hall
Honored Contributor

Re: How to delete files from FTP site

John, Hoff,

I tested $delete/ftp on VMS V8.3 and TCP/IP Services V5.6 ECO2 and it does work. There is no help for delete/ftp however.
$delete/ftp remote.domain.com"username password"::y.obj;*/log
%TCPIP-S-FTP_FILDEL, Y.OBJ;* deleted

Bill
Bill Hall
Bill Hall
Honored Contributor

Re: How to delete files from FTP site

John, Hoff,

Unfortunately, further testing shows that they did not add support for RENAME/FTP.

Bill
Bill Hall
Robert Gezelter
Honored Contributor

Re: How to delete files from FTP site

John,
I do not have access to my 8.3 system at this instant, but there is a command line option to specify an alternate source for command lines.

This file can contain all of the normal FTP commands in sequence. The FTP command itself has USER, PASSWORD, and other options that are useful in this context.

- Bob Gezelter, http://www.rlgsc.com
John T. Farmer
Regular Advisor

Re: How to delete files from FTP site

Under our VMS 7.2 system, FTP was not configured properly for COPY/FTP to work. Since the upgrade to 8.3, the syntax works, so now we are experimenting with it. Thanks for the tip, DELETE/FTP works too, I was confused because it wasn't documented. We had previously been using FTP/input= for a script file, but this didn't provide error traping for each individual step, like the copy and delete commands will. Thanks for all the help.

John
Robert Gezelter
Honored Contributor

Re: How to delete files from FTP site

John,

FTP/INPUT=, done one command at a time will probably return the correct status information.

- Bob Gezelter, http://www.rlgsc.com
labadie_1
Honored Contributor

Re: How to delete files from FTP site

May be you can do
$ backup/lo/del remote"user pass"::file.txt file.bck/sav
and then
bac/lo fil.bck/sav <>
Highly inefficient if you have many files :-(

I am afraid with remote backup, you must have a save-set on one side, so you can do
$ backup/lo a.bck/sav remote"user pass"::*.*
or
$ backup/lo *.* remote"user pass"::a.bck/sav

but I think not
$ backup/lo/dele remote"user pass"::a.txt a.txt

However, I write all that without a Vms node available.
Hoff
Honored Contributor

Re: How to delete files from FTP site

TCP/IP Services has DELETE /FTP now? Cool.

Wonder when that snuck in? Interesting.

It's not documented anywhere I could find with some concerted Google digging. (The most obvious |site:hp.com "delete /ftp"| search turns up zilch.)

Process, on the other hand, has it listed.