openWrt(LEDE)下载包目录dl目录新旧差异脚本备份,阿里百度更新下载连接

在国内编译OpenWrt很困难,有很多包被墙无法下载。

本博客分享提供了 dl 目录镜像的下载链接:

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

阿里云盘:https://www.aliyundrive.com/s/rgrpy8TJxAThttps://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文件链接下载来源:

http://cnblogs.com/sbkill1r/p/14115667.html

共享 dl.zip 下载连接:

https://pan.baidu.com/s/1j9qZ2G7zyF7h5YF3nQJ4SA

差异备份 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 ""

友情链接