2016年7月18日 星期一

(教學)用 wget 下載備份自己的網站

wget --mirror --page-requisites --adjust-extension --no-parent --convert-links
     --directory-prefix=sources  <網站url>


===
--mirror : 遞迴處理子資料夾
--page-requisites:下載圖片等靜態資源
--adjust-extension:站內資源連結檔案加上正確副檔名
--no-parent :不要處理上一層目錄
--convert-links:站內資源連結轉成相對路徑
--directory-prefix=sources:把下載的檔案放在「sources」這個目錄底下
===

示意圖 1(點圖可放大):

linux xubuntu wget 下載備份整個網站


示意圖 2(點圖可放大):

linux xubuntu wget 下載備份整個網站


===
參考資源:

http://stackoverflow.com/questions/6145641/how-to-mirror-only-a-section-of-a-website

http://superuser.com/questions/970323/using-wget-to-copy-website-with-proper-layout-for-offline-browsing

http://stackoverflow.com/questions/1078524/how-to-specify-the-location-with-wget