mv using ftp

mv using ftp

Post by Adrian Bean » Fri, 27 Jun 1997 04:00:00



I have a shell script that copies files across to a VAX.
At present it is using ftp during the script and then checking
for error messages namely "Connection refused". If it gets no error
message then it assumes the file went and deletes it. It strikes me
that this would be cleaner if I could use a "mv" type command in ftp
rather than a "cp" type command. That way if there were problems
connecting the file would remain where it was (for a retry) and if there
were no problems the file would be gone.
Is there a way of doing this in ftp or would I be better off using
a different connection?

 
 
 

mv using ftp

Post by Lars Heckin » Fri, 27 Jun 1997 04:00:00



> I have a shell script that copies files across to a VAX.
> At present it is using ftp during the script and then checking
> for error messages namely "Connection refused". If it gets no error
> message then it assumes the file went and deletes it. It strikes me
> that this would be cleaner if I could use a "mv" type command in ftp
> rather than a "cp" type command. That way if there were problems
> connecting the file would remain where it was (for a retry) and if there
> were no problems the file would be gone.
> Is there a way of doing this in ftp or would I be better off using
> a different connection?

 You could open a second connection after uploading, dir the directory
 where the file was put, and then decide whether to delete the file
 or not.

 
 
 

mv using ftp

Post by Boyd Rober » Fri, 27 Jun 1997 04:00:00



>Is there a way of doing this in ftp or would I be better off using
>a different connection?

Duh?  The 'rename' command.

   system% ftp
   ftp> ?
   Commands may be abbreviated.  Commands are:
   ...
   rename

--

``Not only is UNIX dead, it's starting to smell really bad.'' -- rob

 
 
 

mv using ftp

Post by GT Chere » Sat, 28 Jun 1997 04:00:00


: Is there a way of doing this in ftp or would I be better off using
: a different connection?

read the rfc.
use the return codes rather than grepping for phrases.
if ftp tells you that it successfully delivered the file, why not believe
him? if you can't believe ftp, why would you believe 'ls' or 'dir'? if you
do insist on double confirmation, do the put then follow it with an
ls/dir.
the "mv/rename/put x y" doesn't buy you anything.
read the rfc.

--

Stay hungry. Failure is the path of least persistence.

 
 
 

1. source for basic utils like ftp/cp/mv... where?

hello!

well i wonder where the source to things like the ftp-command, ie the
client, and cp, mv and such is.
dont say "it comes with your distribution", because i am looking for the
authorative source. where do those who make distributions get the source
in the first place?

besides, in my slack7.1 i have found no source.

is there some main site that publishes all the sources? or are they
scattered all over the net? if so, how the h**l do i find them?

thanks in adv / alex k

2. ATAPI CD-ROM not detected

3. rksh - does not stop mv around with ftp

4. question on gateD

5. %MANIFEST, $S$(MV), and -@dir of make using bash on Linux

6. XIM problem

7. using mv

8. screwy disk stats

9. trouble with using find and mv

10. Problem using mv

11. %MANIFEST, $S$(MV), and -@dir three questions of make using bash on Linux

12. Moving SysV initialization scripts using only mv and a shell.

13. trying to move (mv) files using "uux"