The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Advanced & Expert Users
Google UNIX.COM


UNIX for Advanced & Expert Users Advanced UNIX and Linux questions go here. Expert-to-Expert.

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1  
Old 12-22-2004
Registered User
 

Join Date: Nov 2001
Posts: 59
Question FTP Question

Once a file is ftped to a server is there a way that you can prevent that file from being overwritten if the same process tries to ftp a file with the same name again?
Reply With Quote
Forum Sponsor
  #2  
Old 12-22-2004
...@...
 

Join Date: Feb 2004
Location: NM
Posts: 4,269
ftp doesn't directly provide a way to stop that.
Some ftp versions support the "!" operator which allows remote execution of a shell command - which is not very secure.

Anyway, consider something like this.
[code]
!/bin/chmod 000 filename
[/codee]
Reply With Quote
  #3  
Old 12-22-2004
Registered User
 

Join Date: Nov 2001
Posts: 59
Thanks

thank you.
Reply With Quote
  #4  
Old 12-22-2004
Perderabo's Avatar
Unix Daemon
 

Join Date: Aug 2001
Location: Washington DC Area
Posts: 8,616
Many more ftp servers support the chmod command. If your client does not support
chmod 444 filename
you can still try the site command:
site chmod 444 filename

Jim, I have never seen that ! stuff on any ftp server. Where did you see it?
Reply With Quote
  #5  
Old 12-22-2004
...@...
 

Join Date: Feb 2004
Location: NM
Posts: 4,269
Some of the original versions of ftp come from Washington State University - and it supports the bang operator - it was undocumented.

I'm just showing my age. The site command is in fact much more common now.
Reply With Quote
  #6  
Old 12-24-2004
google's Avatar
Moderator
 

Join Date: Jul 2002
Location: Atlanta
Posts: 740
Quote:
remote execution of a shell command
Yeah that ! is really good stuff. I use it all the time. We are using HPUX 11.x. But on my system, ! exits you back to the shell on your local system, not the remote system. You can actually simply type "!" and it will toggle you out of the FTP session and back to the shell. When your finished doing what you need to do in the shell you can type exit and it will toggle you back to your open FTP session (assuming you didnt take so long that it caused the FTP session to time out)

Last edited by google; 12-24-2004 at 06:46 AM.
Reply With Quote
  #7  
Old 12-29-2004
Registered User
 

Join Date: Jan 2001
Posts: 48
Hi,

Yes, Google is absolutely Right.

The '!' allows you to have a (cofee-)break with the FTP and enter
in to shell from where you can return back (just for time being if you wish) with the exit command at the shell.

This takes you to shell while still ftp being running, and you can
return back by just typing exit at the console/shell prompt.
Since '!' takes you to the shell, and you can execute any shell
command as usual, you can do the same (execute any shell command)
with out completely coming out of FTP.

In simple, from the FTP application itself, you can execute any
valid shell command by just prefixing the command with a Bang ('!').

Ex:-

ftp> !ls -l
or
ftp> !who
or
ftp> !man ftp

etc.,

This way you can avoid un-necessarily going out and comming in
of FTP just for executing some command at shell.
And this is supported in all most all of the Unix Flavours.
And even Microsoft Windows also holds good with this concept.

Vishwa.
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 03:41 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0