FTP Question


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users FTP Question
# 1  
Old 12-22-2004
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?
# 2  
Old 12-22-2004
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]
# 3  
Old 12-22-2004
Thanks

thank you.
# 4  
Old 12-22-2004
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?
# 5  
Old 12-22-2004
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.
# 6  
Old 12-24-2004
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 09:46 AM..
# 7  
Old 12-29-2004
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.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

ftp question

I have this FTP script: ADDR=168.218.95.172 ftp -inv $ADDR <<- ftpcmds user HEHCFTP H$h673sp ... (3 Replies)
Discussion started by: lena keung
3 Replies

2. Shell Programming and Scripting

FTP question

HI In my script its like this ------------ echo "Enter filename" read fname ftp -v -n abcd.efh.kk.com << EOF user userid pwd bin mget $fname.tar--not working if i give "$fname", works only as "demo.tar" bye ------------ My target is to get a $fname.tar from a remote host.How... (4 Replies)
Discussion started by: coolkid
4 Replies

3. Shell Programming and Scripting

ftp question

Hi, i have a simple question here-- if we dont use binary while doing a ftp of a file,any sort of problem can arise from this or it is ok. Thanks (2 Replies)
Discussion started by: namishtiwari
2 Replies

4. UNIX for Dummies Questions & Answers

Question on FTP

Hi All, I'm new to this group and this is my first post to this group. I need to write a shell script for the requirement given below: 1. I need to connect to a ftp server with my username and password 2. I need to go to some(input) directory. 3. I will have files with same names and... (1 Reply)
Discussion started by: ranjith_taurean
1 Replies

5. UNIX for Dummies Questions & Answers

FTP Question

How do you limit an ftp user access to a certain Unix path when putting/getting file to/from your server? And how do you restrict the ftp user from using "cd" or "ls" commands? Given that the ftp user knows the ftp userid, password, and your server ip address. Thanks in advanced :) (1 Reply)
Discussion started by: XZOR
1 Replies

6. UNIX for Dummies Questions & Answers

FTP Question

I'm basically trying to FTP a file to a differnt node, first putting the FTP commmands into a text file and then piping the commands file into the ftp command as follows.... echo "user $USERNAME $PASSWORD" > ftp_cmds echo "put $SQLOUT /users/$USERNAME/$SQLOUT" >> ftp_cmds echo "quit" >>... (4 Replies)
Discussion started by: djkane
4 Replies

7. UNIX for Dummies Questions & Answers

FTP Question

When a user FTP's to their own directory, they can go up the directory and view others files, of course they can not overwrite them but are able to download them if they wish to, is there any way to stop them from view their files and have them be only able to view files that they have permissions... (3 Replies)
Discussion started by: foresthillian
3 Replies

8. UNIX for Advanced & Expert Users

FTP Question

Hi, I'm attempting to FTP several files using MGET. My problem is that I need to cd to a directory with this naming convention: YYMMDDHHMM - where the hour and minute is unknown When I issue cd /ftpdirectory/YYMMDD* from FTP, I receive "No such file or directory I need a way to get the... (6 Replies)
Discussion started by: kdreaves
6 Replies

9. UNIX for Dummies Questions & Answers

FTP Question

I am really new to unix and want to setup an ftp server on my PC I am running a Ultra 5 with solaris 9 on it. I cannot seem to find *any* documentation on how to do this. So I was hoping somebody could point me in the right direction. :confused: (3 Replies)
Discussion started by: ls=dir
3 Replies

10. UNIX for Dummies Questions & Answers

FTP question

Hi all, I have a simple script that runs each night and transfers a number of files to a remote server. Before files are transferred existing files on the remote box are deleted. All works OK except the deletion part on the remote box returning no such file or directory. As work around Ihave... (2 Replies)
Discussion started by: tzp2ft
2 Replies
Login or Register to Ask a Question