LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   ftp to remove file (https://www.linuxquestions.org/questions/linux-newbie-8/ftp-to-remove-file-656519/)

ust 07-17-2008 09:21 PM

ftp to remove file
 
I would like to write a scritp to use ftp to get a file , then remove it , I can get the file now , but how to remove it after get , I tried the command in ftp ( eg. remove , del , delete * ) but still not work , can advise what can i do ? thx

jailbait 07-17-2008 09:28 PM

The site from which you downloaded the file must set the permissions on the file to allow you write access before you can delete it. If you do not have write permission then you cannot delete the file.

-------------------------
Steve Stites

ust 07-17-2008 09:41 PM

Quote:

Originally Posted by jailbait (Post 3218314)
The site from which you downloaded the file must set the permissions on the file to allow you write access before you can delete it. If you do not have write permission then you cannot delete the file.

-------------------------
Steve Stites



thx reply ,

the user have full permission , what command ( eg .remove , del , delete ) should I use ? thx

ust 07-17-2008 10:38 PM

I tried , it should use del , but if use del * , it is not work , if use del filenMe , it is OK , if I want to remove all file in a file , what can i do ? thx

rikijpn 07-17-2008 10:42 PM

probably rm?
 
Did you try
Code:

rm file
?
Or, you could just type
Code:

?
while on ftp on the remote computer to check for the commands.

ust 07-18-2008 12:50 AM

Quote:

Originally Posted by rikijpn (Post 3218371)
Did you try
Code:

rm file
?
Or, you could just type
Code:

?
while on ftp on the remote computer to check for the commands.

thx reply

I tried mdelete , it is OK to remove the file in remote site , but still show the below message after run it , can advise what is wrong ? thx

Delete operation failed.

ust 07-18-2008 02:41 AM

I have one more question ,

I edited this ftp script , it can put and get the files well ,if I want to add a comparsion script (eg. comparsion_script) to this ftp script , can advise what can i do ? Thx

ftp remote_server<<EOF
prompt off
lcd dir1
passive
cd dir1
put *
lcd dir2
get *
mdelete *
comparsion_script
EOF


All times are GMT -5. The time now is 11:49 AM.