LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-17-2008, 10:21 PM   #1
ust
Senior Member
 
Registered: Mar 2003
Location: fasdf
Distribution: Debian / Suse /RHEL
Posts: 1,130

Rep: Reputation: 30
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
 
Old 07-17-2008, 10:28 PM   #2
jailbait
LQ Guru
 
Registered: Feb 2003
Location: Blue Ridge Mountain
Distribution: Debian Jessie, Linux Mint 17
Posts: 7,751

Rep: Reputation: 272Reputation: 272Reputation: 272
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
 
Old 07-17-2008, 10:41 PM   #3
ust
Senior Member
 
Registered: Mar 2003
Location: fasdf
Distribution: Debian / Suse /RHEL
Posts: 1,130

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by jailbait View Post
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
 
Old 07-17-2008, 11:38 PM   #4
ust
Senior Member
 
Registered: Mar 2003
Location: fasdf
Distribution: Debian / Suse /RHEL
Posts: 1,130

Original Poster
Rep: Reputation: 30
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
 
Old 07-17-2008, 11:42 PM   #5
rikijpn
Member
 
Registered: Jun 2007
Location: Japan
Distribution: Debian lenny, DSL, Solaris 10
Posts: 157

Rep: Reputation: 33
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.
 
Old 07-18-2008, 01:50 AM   #6
ust
Senior Member
 
Registered: Mar 2003
Location: fasdf
Distribution: Debian / Suse /RHEL
Posts: 1,130

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by rikijpn View Post
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.
 
Old 07-18-2008, 03:41 AM   #7
ust
Senior Member
 
Registered: Mar 2003
Location: fasdf
Distribution: Debian / Suse /RHEL
Posts: 1,130

Original Poster
Rep: Reputation: 30
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
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
In plesk , I wish to have a backup cron job, ftp back up file to another ftp server? muskiediver Linux - General 6 07-16-2009 04:13 AM
Bash remove part of a file based on contents of another file bhepdogg Programming 4 01-31-2007 04:13 PM
c++ file processing -- how to remove a record from a file sharonyiisl Programming 4 09-26-2004 04:54 AM
How to remove FTP access restrictions goodman Linux - Newbie 4 08-16-2003 07:07 PM
add/remove packages via FTP Gavin Linux - Software 1 03-05-2003 07:40 AM


All times are GMT -5. The time now is 06:36 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration