openWrt(LEDE)下載包目錄dl目錄新舊差異腳本備份,阿里百度更新下載連接


在國內編譯OpenWrt很困難,有很多包被牆無法下載。

 

本博客分享提供了 dl 目錄鏡像的下載鏈接:

dl.zip + dl更新補丁包.zip(“dl.zip” 和 “dl_日期.zip” 文件全都要下載,大小:約4.01GB)

阿里雲盤:https://www.aliyundrive.com/s/rgrpy8TJxAT
https://www.aliyundrive.com/s/PvRsbNBRUs8https://www.aliyundrive.com/s/PvRsbNBRUs8https://www.aliyundrive.com/s/PvRsbNBRUs8「openWrt環境」https://www.aliyundrive.com/s/PvRsbNBRUs8 點擊鏈接保存,或者復制本段內容,打開「阿里雲盤」APP ,無需下載極速在線查看,視頻原畫倍速播放。

百度雲盤:https://pan.baidu.com/s/1cnpmAej2HApcGqKcVoe1dg?pwd=1111 提取碼: 1111

   注:阿里&百度網盤下載,二選一即可

 

腳本功能:

      dl目錄文件包不停的更新,但是每次全量備份,浪費時間,腳本會比對本次和上次備份的文件差異。

只把新增的包打包備份。

     所以,下包“dl.zip” 和“dl_日期.zip”更新文件都要下載。並全部解壓到dl目錄下。

 

使用方法:

  1. 下載網盤里 “dl目錄備份&更新” 目錄。

  2. 將下載的 *.zip 文件全部解壓(批量解壓命令:ls -1 | xargs -n1 dl*.zip)。

  3. 解壓出來的文件放到本地 OpenWrt(LEDE) 的 dl 目錄下即可。

 

差異備份 dl 目錄,腳本:

文件名:openWrt-lede_dl_pkg_bak.sh

#!/bin/bash
# Date:2022/03/12
# Date:2022/03/27
#查看dl.zip和lede/dl/文件夾,包的差異
#並自動復制打包

datetime=`date +"%Y%m%d"`

# openwrt的主目錄,雙引號里修改成你自己openwrt(lede)的dl路徑
openwrt_home=~/lede/dl/

## 當前備份shell腳本所在目錄,不用改,自動獲取sh文件自己所在目錄
sh_pwd=`pwd`
#echo ${sh_pwd}

## 新建目錄
if [ ! -d ~/dl ];then
	mkdir -p ${sh_pwd}/dl/
fi
##新建.last_bak_pkg_lists.txt文件
if [ ! -f .last_bak_pkg_lists.txt ];then
	echo " " >> .last_bak_pkg_lists.txt
fi

##新建dl_${datetime}.zip_lists.txt文件
if [ ! -f dl_${datetime}.zip_lists.txt ];then
	echo " " >> dl_${datetime}.zip_lists.txt
fi

## 列出本級當前openwrt(lede)/dl/目錄文件
ls -1 ${openwrt_home} >.current_dl_lists_temp.txt

## 列出老的dl.zip包文件名
unzip -v ~/dl.zip |awk -F'/' '{print $2}' | grep -vE "^$" > .old_dl_zip_lists.txt

## 列出dl.zip包里目錄內容,對比后,差異放入dl_${datetime}.zip_lists.txt
#unzip -v dl.zip |awk -F'/' '{print $2}' |grep -v "`cat 2dl.txt`" <-- 錯誤的過濾順序
cat .current_dl_lists_temp.txt| grep -v "`cat .old_dl_zip_lists.txt`"|grep -v "`cat .last_bak_pkg_lists.txt`"| grep -vE "^$" > dl_${datetime}.zip_lists.txt

## 備份列表空,則退出
num_list=`wc -l dl_${datetime}.zip_lists.txt| awk '{print $1}'`
if [ ${num_list} -eq 0 ];then
	echo ""
	### 清理已經備份的臨時dl文件夾(不是你openwrt(lede)目錄的dl文件夾)
	rm -rf dl/
	### 清理臨時文件
	rm -f .current_dl_lists_temp.txt .old_dl_zip_lists.txt dl_${datetime}.zip_lists.txt
	echo "[ info ] Back list is null . wc -l dl_${datetime}.zip_lists.txt = ${num_list}"
	echo ""
	exit
fi
## 備份新包
cd ${openwrt_home}
#pwd
echo "[ info ] Begin copy 'dl_${datetime}.zip_lists.txt'"
for file in `cat ${sh_pwd}/dl_${datetime}.zip_lists.txt`
do
	\cp -ar ${file} ${sh_pwd}/dl/
done

##切換回sh文件所在目錄
cd ${sh_pwd}
pwd

##打包
zip -r dl_${datetime}.zip dl/

## 本次備份過的列表追加到上一次列表中
## 防止重復備份
cat ${sh_pwd}/dl_${datetime}.zip_lists.txt >> ${sh_pwd}/.last_bak_pkg_lists.txt

## 清理已經備份的臨時dl文件夾(不是你openwrt(lede)目錄的dl文件夾)
rm -rf dl/

## 清理臨時文件
rm -f .current_dl_lists_temp.txt .old_dl_zip_lists.txt

echo ""
echo "[ info ] Backup ZIP file name : dl_${datetime}.zip"
echo "[ info ] Backup ZIP lists log file name : dl_${datetime}.zip_lists.txt"
echo ""
echo "[ info ] Backup 'dl' pkg done."
echo ""

 

 

dl文件鏈接下載來源:

http://cnblogs.com/sbkill1r/p/14115667.html 共享 dl.zip 下載連接:https://pan.baidu.com/s/1j9qZ2G7zyF7h5YF3nQJ4SA

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM