LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
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 06-21-2006, 07:17 AM   #16
timmeke
Senior Member
 
Registered: Nov 2005
Location: Belgium
Distribution: Red Hat, Fedora
Posts: 1,515

Rep: Reputation: 61

Check out the "mirror" option. This may do the trick.

However, I typically use something like:
Code:
cd /home/mrgreaper/srcds_1/cstrike/maps/
wget -N -r -l inf --no-parent -nH -a some_logfile --ftp-user=some_user --ftp-password=some-password ftp://my.ftp.ip/maps/
When using wget in recursive mode (-r), you don't need to specify "*.*". It'll search through the directory structure recursively.
-N makes it look at timestamps on files (in addition to filesizes) to download only updated and new files.
You may want to add options like -A '*.nav,*.bsp' to get only the .nav and .bsp files.

Just try it. You'll see that it's fairly easy to use and has plenty of options. As I said, setting up the FTP server (with sufficient security) is usually the hard part...
 
Old 06-21-2006, 10:36 AM   #17
mrgreaper
Member
 
Registered: May 2006
Posts: 167

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by timmeke
Check out the "mirror" option. This may do the trick.

However, I typically use something like:
Code:
cd /home/mrgreaper/srcds_1/cstrike/maps/
wget -N -r -l inf --no-parent -nH -a some_logfile --ftp-user=some_user --ftp-password=some-password ftp://my.ftp.ip/maps/
When using wget in recursive mode (-r), you don't need to specify "*.*". It'll search through the directory structure recursively.
-N makes it look at timestamps on files (in addition to filesizes) to download only updated and new files.
You may want to add options like -A '*.nav,*.bsp' to get only the .nav and .bsp files.

Just try it. You'll see that it's fairly easy to use and has plenty of options. As I said, setting up the FTP server (with sufficient security) is usually the hard part...
i`m in the process of getting ready for work so it will be at least 16 hours till i get to try it more likely more

i assume with the command above it would check the folders inside maps as well?
for example the sound cache and graph folders and if it finds any new files in them it would copy them to the relevent folder on the local machine

so if we got cs_office.cache added to soundcache folder inside the map folder it would see the new file on the ftp look at the soundcache folder within /home/mrgreaper/srcds_1/cstrike/maps/ on the local machine realese the local machine didnt have it and create it?

basicly would it keep the folders on the local machine up to date in full so if new folders are created both they and there content is copyed to the server ?

i know im asking a lot, i`m sorry to pester i just find the manual pages are written for more competent users then me, your help and assistence is as always extremely regarded thank you
 
Old 06-22-2006, 10:48 AM   #18
mrgreaper
Member
 
Registered: May 2006
Posts: 167

Original Poster
Rep: Reputation: 15
cd /home/mrgreaper/srcds_1/cstrike/
wget -N -r -l inf --no-parent -nH -a some_logfile --ftp-user=some_user --ftp-password=some-password ftp://my.ftp.ip/maps/

worked a treat again thanks guys
 
Old 06-23-2006, 04:24 AM   #19
timmeke
Senior Member
 
Registered: Nov 2005
Location: Belgium
Distribution: Red Hat, Fedora
Posts: 1,515

Rep: Reputation: 61
Yep, it'll check for subfolders too, thanks to "-r -l inf" (-r makes it recursive - ie looking through subfolders, -l inf makes it search through all levels (an "infinite" number of levels) of subfolders).
It will create files and subfolders as needed.

You can even toy around with options like -X to exclude certain files or subfolders (based on wildcard patterns like "*.cache"). I often also use -A option to limit the downloads to only certain files, ie -A "*.ZIP" to get only *.ZIP files.

--cut-dirs=n makes wget cut off "n" directories from the target path.
ie: if your target is ftp://my.ftp.ip/maps/, then -nH will make wget not create a folder called "my.ftp.ip", --cut-dirs=1 will make it not create a "maps" folder (but it will create subfolders of "maps" if needed). -nd should prevent wget from creating any directories.

Should the download be interrupted, just add the "-c" option to make wget continue the file downloads that were interrupted.

--mirror can be a useful shorthand for "-N -r -l inf --no-remove-listing" in your case. Only difference to your command is the "--no-remove-listing" option (makes wget not throw away the list of downloaded files).

Last edited by timmeke; 06-23-2006 at 04:27 AM.
 
  


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
Perl/CGI Creating Auto Logouts (like bank sites) anthonysaulnier Programming 3 10-17-2005 12:36 PM
Creating Linked Lists from items in a file SeniorSE Programming 5 09-14-2005 10:53 PM
how do I search for multiple filetypes? fisayo Linux - General 4 07-19-2005 07:05 AM
Apache filetypes and downloads gcobb Fedora 1 02-12-2005 07:55 PM
GNOME filetypes sanmadjack Linux - Software 1 07-11-2004 02:58 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:55 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