LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 12-21-2004, 04:46 PM   #1
doctorwebbox
Member
 
Registered: Jun 2003
Location: Rotherham, South Yorkshire, England
Distribution: Debian
Posts: 117

Rep: Reputation: 15
Deleting files in bulk through ftp


I am trying to write a bash script to update our work website using data from our mysql server.

I want to send a command to delete a folder and all the files and folders in it recursively. I pretty much want to do rm $DIRECTORY -fr but through ftp.

Can anyone help?
 
Old 12-21-2004, 07:47 PM   #2
bulliver
Senior Member
 
Registered: Nov 2002
Location: Edmonton AB, Canada
Distribution: Gentoo x86_64; Gentoo PPC; FreeBSD; OS X 10.9.4
Posts: 3,760
Blog Entries: 4

Rep: Reputation: 78
Check out lftp. It is a command line ftp client that can be scripted (check out the -f option)

If you know Perl you can use the Net::FTP module to script ftp sessions
 
Old 12-25-2004, 12:43 PM   #3
doctorwebbox
Member
 
Registered: Jun 2003
Location: Rotherham, South Yorkshire, England
Distribution: Debian
Posts: 117

Original Poster
Rep: Reputation: 15
lftp

I gave lftp a try. It will let me remove files recursively but leaves the folders. This is what I am tryig to achieve.

A script creates a little directory tree with several html pages and images in them.

There is a folder on our webspace put aside for hosting these files and folders.

I want to ftp into the remote folder. Delete everything in it, including folders and their contents.

Copy ALL the files and folders from a specific folder on my computer to the remote folder.

Unfortunately I can't find a command to remove all files and folders throught ftp and I can't find a way to transfers ALL files and folders recursively.

Can you help?
 
  


Reply



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
Deleting files in C monil Programming 4 03-13-2005 10:33 AM
Deleting files! a_priebe47 Slackware 6 10-17-2004 09:58 PM
Deleting files ShakyJake Linux - Newbie 12 05-08-2003 03:07 PM
Deleting files Tingle Linux - Newbie 4 01-16-2003 04:19 PM
Deleting tar files chamkila Linux - General 2 11-02-2002 03:36 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 12:24 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
Open Source Consulting | Domain Registration