New Posts  All Forums:Forum Nav:

wget to mirror site - Page 2

post #11 of 15
Thread Starter 
does it matter if I write -X as -X or --exclude?? I also see a lot of people writing it out in .sh files and I wanted to know is declaring bash in header and each line needed to be ended with /
OverKill
(18 items)
 
  
CPUMotherboardGraphicsGraphics
AMD Phenom II X6 1055T Gigabyte 890FXA ATI FirePro V3800 ATI FirePro V3800 
RAMHard DriveHard DriveOptical Drive
16gb GSkill 10666 Seagate Western Digital  LG Blue Ray 
CoolingOSMonitorMonitor
stock air 7 Pro 64 bit (2)22" Acer x223w (2)23" Acer G235H 
KeyboardPowerCaseMouse
Microsoft Wireless Antec 900watt Antec 300 Wacom Tablet 
Audio
Logitech Speakers and sub 
  hide details  
Reply
OverKill
(18 items)
 
  
CPUMotherboardGraphicsGraphics
AMD Phenom II X6 1055T Gigabyte 890FXA ATI FirePro V3800 ATI FirePro V3800 
RAMHard DriveHard DriveOptical Drive
16gb GSkill 10666 Seagate Western Digital  LG Blue Ray 
CoolingOSMonitorMonitor
stock air 7 Pro 64 bit (2)22" Acer x223w (2)23" Acer G235H 
KeyboardPowerCaseMouse
Microsoft Wireless Antec 900watt Antec 300 Wacom Tablet 
Audio
Logitech Speakers and sub 
  hide details  
Reply
post #12 of 15
Code:
wget -np -kprmFE -P <foldername> <website_root_to_mirror>

That will mirror it, as well as redo the HTML coding and make it local. Don't remember if that was part of your goal, but you can always remove some of the flags to get what you want.
post #13 of 15
Quote:
Originally Posted by graphicsman View Post

does it matter if I write -X as -X or --exclude??
Readability is the only reason. Single character parameters are great for banging out CLI instructions at speed, spelling out the whole word is great for shell scripts where you're bound to read back in a few weeks / months time and wonder what the hell -sdfWEFAWz all does laugher.gif
Quote:
Originally Posted by graphicsman View Post

I also see a lot of people writing it out in .sh files and I wanted to know is declaring bash in header and each line needed to be ended with /
do you mean / at the end of URLs or \ at the end of lines where you have multi-line commands.

eg
Code:
wget example.com/

or
Code:
wget -np -kprmFE \
-P <foldername> \
<website_root_to_mirror>

The former is just a URL and deciding whether to put a slash on there or not doesn't really matter a whole lot. A bit like how it doesn't matter whether you cd /home or cd /home/.

The latter is just telling linux to concatenate the next line in to the current one. eg
Code:
echo 1\
2\
3
is exactly the same as echo 123 and thus will print 123.
post #14 of 15
Thread Starter 
well I saw this and if I download for a project and with some other bash I wanted to be able to go back and read what exactly I did.
OverKill
(18 items)
 
  
CPUMotherboardGraphicsGraphics
AMD Phenom II X6 1055T Gigabyte 890FXA ATI FirePro V3800 ATI FirePro V3800 
RAMHard DriveHard DriveOptical Drive
16gb GSkill 10666 Seagate Western Digital  LG Blue Ray 
CoolingOSMonitorMonitor
stock air 7 Pro 64 bit (2)22" Acer x223w (2)23" Acer G235H 
KeyboardPowerCaseMouse
Microsoft Wireless Antec 900watt Antec 300 Wacom Tablet 
Audio
Logitech Speakers and sub 
  hide details  
Reply
OverKill
(18 items)
 
  
CPUMotherboardGraphicsGraphics
AMD Phenom II X6 1055T Gigabyte 890FXA ATI FirePro V3800 ATI FirePro V3800 
RAMHard DriveHard DriveOptical Drive
16gb GSkill 10666 Seagate Western Digital  LG Blue Ray 
CoolingOSMonitorMonitor
stock air 7 Pro 64 bit (2)22" Acer x223w (2)23" Acer G235H 
KeyboardPowerCaseMouse
Microsoft Wireless Antec 900watt Antec 300 Wacom Tablet 
Audio
Logitech Speakers and sub 
  hide details  
Reply
post #15 of 15
Quote:
Originally Posted by graphicsman View Post

well I saw this and if I download for a project and with some other bash I wanted to be able to go back and read what exactly I did.

ahh yes, that's just the latter example i gave. It's just a way of allowing a single Linux / UNIX command to span multiple lines without the carriage return being included in the command itself.

so
Code:
wget \
     --recursive \
     --no-clobber \
     --page-requisites \
     --html-extension \
     --convert-links \
     --restrict-file-names=windows \
     --domains website.org \
     --no-parent \
         www.website.org/tutorials/html/

is literally the same thing as
Code:
wget --recursive --no-clobber --page-requisites --html-extension --convert-links --restrict-file-names=windows --domains website.org --no-parent www.website.org/tutorials/html/
personally I hate it when people do that as all it does make long commands more readable. But i guess that's necessary when writing blogs and tutorials.
New Posts  All Forums:Forum Nav:
  Return Home
  Back to Forum: Coding and Programming