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

推荐订阅源

雷峰网
雷峰网
T
The Exploit Database - CXSecurity.com
Engineering at Meta
Engineering at Meta
T
Troy Hunt's Blog
大猫的无限游戏
大猫的无限游戏
云风的 BLOG
云风的 BLOG
J
Java Code Geeks
Latest news
Latest news
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
C
Check Point Blog
Recent Announcements
Recent Announcements
F
Fortinet All Blogs
A
Arctic Wolf
酷 壳 – CoolShell
酷 壳 – CoolShell
H
Hackread – Cybersecurity News, Data Breaches, AI and More
Vercel News
Vercel News
S
Schneier on Security
Cyberwarzone
Cyberwarzone
N
Netflix TechBlog - Medium
AWS News Blog
AWS News Blog
Scott Helme
Scott Helme
G
GRAHAM CLULEY
SecWiki News
SecWiki News
N
News and Events Feed by Topic
有赞技术团队
有赞技术团队
Google DeepMind News
Google DeepMind News
H
Heimdal Security Blog
GbyAI
GbyAI
C
Cybersecurity and Infrastructure Security Agency CISA
D
Docker
S
Secure Thoughts
博客园 - 三生石上(FineUI控件)
S
SegmentFault 最新的问题
aimingoo的专栏
aimingoo的专栏
博客园 - 叶小钗
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
F
Full Disclosure
L
LINUX DO - 热门话题
Help Net Security
Help Net Security
博客园 - 司徒正美
C
Cisco Blogs
月光博客
月光博客
O
OpenAI News
P
Proofpoint News Feed
Attack and Defense Labs
Attack and Defense Labs
S
Security @ Cisco Blogs
L
Lohrmann on Cybersecurity
宝玉的分享
宝玉的分享
D
DataBreaches.Net
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO

博客园 - 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)  评论()    收藏  举报