惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

L
LINUX DO - 热门话题
Engineering at Meta
Engineering at Meta
GbyAI
GbyAI
Microsoft Security Blog
Microsoft Security Blog
月光博客
月光博客
Jina AI
Jina AI
博客园_首页
Google DeepMind News
Google DeepMind News
T
Tailwind CSS Blog
博客园 - 司徒正美
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
腾讯CDC
Recorded Future
Recorded Future
大猫的无限游戏
大猫的无限游戏
G
Google Developers Blog
D
Docker
罗磊的独立博客
美团技术团队
爱范儿
爱范儿
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
云风的 BLOG
云风的 BLOG
宝玉的分享
宝玉的分享
J
Java Code Geeks
U
Unit 42
Hugging Face - Blog
Hugging Face - Blog
H
Hackread – Cybersecurity News, Data Breaches, AI and More
SecWiki News
SecWiki News
T
Troy Hunt's Blog
H
Heimdal Security Blog
The Cloudflare Blog
Webroot Blog
Webroot Blog
aimingoo的专栏
aimingoo的专栏
Security Archives - TechRepublic
Security Archives - TechRepublic
F
Full Disclosure
AI
AI
Recent Commits to openclaw:main
Recent Commits to openclaw:main
Last Week in AI
Last Week in AI
T
The Exploit Database - CXSecurity.com
V
V2EX
Spread Privacy
Spread Privacy
M
MIT News - Artificial intelligence
量子位
Y
Y Combinator Blog
阮一峰的网络日志
阮一峰的网络日志
NISL@THU
NISL@THU
Hacker News: Ask HN
Hacker News: Ask HN
The GitHub Blog
The GitHub Blog
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
N
News and Events Feed by Topic
Attack and Defense Labs
Attack and Defense Labs

博客园 - Don

在Chrome中调试Android微信浏览器中的网页,不出现供选择页面的怎么办?(chrome://inspect/#devices) 使用Crontab集合sh脚本自动删除过期的Confluence Docker容器中的备份文件 Docker PHP中安装gd扩展并生成图形验证码 解决命令行提示“cannot create temp file for here-document: No space left on device”但磁盘使用率并未满的问题 SSH登录后提示LC_ALL: cannot change locale (en_US.UTF8) 的解决办法 解决git操作一直要求输入用户名和密码的问题 CentOS如何增加虚拟内存 RabbitMQ集群脑裂故障处理 Alibaba Centos ECS 安全更新记录 AWS EC2配置CloudWatch 记录AWS Linux2 的yum安全更新步骤 记录Docker系统盘空间占用过大的解决方法 AWS EC2 EBS数据盘挂载与相关日常维护操作 AWS Amazon Linux2 安装Docker和Docker Compose [转]提升 Docker Desktop For macOS 磁盘使用率 AndroidGetAPKInfo --- 检查包名(packageName)、版本(versionName\versionCode)、应用签名(Signature)等信息 - Don OpenSSL命令—pkcs12 Linux下User与Group的常用操作命令解析 Docker搭建openvpn - Don
zookeeper日志定时清理
Don · 2022-09-16 · via 博客园 - Don

创建zkclean.sh文件

#!/bin/bash

#snapshot file dir
dataLogDir=/docker/zookeeper/datalog/version-2
#transction file dir
dataDir=/docker/zookeeper/datalog/version-2

#保留最新的50个文件
count=50
count=$[$count+1]
##按照时间正序排列|展示从头开始第count行开始|传入执行参数
#事务日志
LOGNUM=`ls -l $dataDir/log.* |wc -l`
if [ $LOGNUM -gt 0 ]; then
    ls -t $dataDir/log.* | tail -n +$count | xargs rm -f
fi

#快照日志
SNAPSHOTNUM=`ls -l $dataLogDir/snapshot.* |wc -l`
if [ $SNAPSHOTNUM -gt 0 ]; then
    ls -t $dataLogDir/snapshot.* | tail -n +$count | xargs rm -f
fix 

给sh文件赋权限:

修改crontab并保存生效:

crontab -e
0 1 * * * /docker/zookeeper/zkclean.sh

posted @ 2022-09-16 16:06  Don  阅读(404)  评论()    收藏  举报