只读文件系统 /var/cache/yum/x86 64/7/base/repomd.xml.old.tmp

问题:

1
2
3
4
5
6
7
8
9
10
11
Errno 30] 只读文件系统: '/var/cache/yum/x86_64/7/base/repomd.xml.old.tmp'

分析:
不知道到底是什么,但一定yum源有了问题;
网上搜了一大堆,大多是yum clean清缓存的,没试,应该也行;

解决:
进入/var/cache/yum/, 执行rm -rf x86_64/c, 删除缓存;
报错:rm: 无法删除"xxx": 只读文件系统
执行mount -o remount,rw /, 再次删除;
执行yum repolist;

ok, 搞定

参考:https://blog.csdn.net/xue15029240296/article/details/103211911

Read More

shell时间戳

1
2
3
4
5
6
7
8
9
用shell将时间字符串与时间戳互转:
date -d "2010-10-18 00:00:00" +%s
输出形如:1287331200

而时间戳转换为字符串可以这样做:
date -d @1287331200 "+%Y-%m-%d"
输出形如:2010-10-18

时间戳可以理解为秒数,是可以加减的

下载离线网页

1
2
3
4
5
6
7
wget -r -p -np -k http://xxx.com/xxx

-r, --recursive(递归) specify recursive download.(指定递归下载)
-k, --convert-links(转换链接) make links in downloaded HTML point to local files.(将下载的HTML页面中的链接转换为相对链接即本地链接)
-p, --page-requisites(页面必需元素) get all images, etc. needed to display HTML page.(下载所有的图片等页面显示所需的内容)
-np, --no-parent(不追溯至父级) don't ascend to the parent directory.
另外断点续传用-nc参数 日志 用-o参数