Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

Okay so I have a website maintenance job to do today. Client has a FTP server with the website on. Fairly standard (albeit outdated) stuff.

I need to do a find-and-replace over most of the html files to change the navigation. To do that effectively, I'd need to do that locally.

The FTP server is full of rubbish. The guy has been using it to exchange files with his clients. I want to get a copy of all the relevant files but at the same time, I don't want to waste time downloading dozens gigabytes of stuff I'll never need.

The FTP is mounted in ~/.gvfs at the moment. Is there something quick and easy I can do to copy all the .html files out, keeping the directory structure so that when I'm done working on the files, I can just copy them back using merge/replace?

share|improve this question
    
I don't have the time at the moment to write a script, but here's how I'd do it: 1) copy the directory structure using find . -type d and mkdir -p 2) copy the files using find . -name '*.html' and cp. –  Georg Schölly Nov 9 '10 at 16:01

2 Answers 2

up vote 1 down vote accepted

You can try using the Filezilla FTP client. It has the ability to create custom file filters from the View menu to only show certain types of files.

share|improve this answer
    
Good call````````````` –  Oli Nov 10 '10 at 23:06

I didn't test this but the following should work:

rsync -av --include "*/" --include "*.html" --exclude "*" ~/.gvfs/. /path/to/destination
share|improve this answer
    
I did try rsync first actually. Kept coming back with rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1060) [sender=3.0.7] (I don't know what the previous errors were because they weren't outputted) –  Oli Nov 9 '10 at 16:31

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.