1. 获取脚本
#!/bin/bash
time=`date "+%H%M-%y%m%d"`
echo $time
mkdir /home/jin/pkgupdateaccount/$time
cd /home/jin/pkgupdateaccount/$time
suite=(xenial xenial-updates bionic bionic-updates disco disco-updates)
arch=amd64
component=(main universe multiverse restricted)
for a in ${suite[@]}
do
for b in ${component[@]}
do
echo "$a-$b"
wget -r https://mirrors.tuna.tsinghua.edu.cn/ubuntu/dists/$a/$b/binary-amd64/Packages.gz
#echo `date "+%H%M-%d/%m/%y"`
done
done
~
2. 定时设置
vim /etc/crontab
这里需要注意用户权限问题
重启命令 service cron restart
3. 查看日志信息
参考文章来源
https://www.jianshu.com/p/60e6ea56088c