1 Star 0 Fork 0

houmingzhang/mycommand

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
mydocker 1.29 KB
一键复制 编辑 原始数据 按行查看 历史
houmingzhang 提交于 2021-11-03 16:10 +08:00 . mydocker
#!/bin/bash
#当前日期
today=`date "+%Y-%m-%d"`
EXCLUDEDIRS="/proc"
EXCLUDEDIRS+=" "
EXCLUDEDIRS+="/sys"
EXCLUDEDIRS+=" "
EXCLUDEDIRS+="/mnt"
EXCLUDEDIRS+=" "
EXCLUDEDIRS+="/var/*"
EXCLUDEDIRS+=" "
EXCLUDEDIRS+="/usr/share/{foomatic,backgrounds,perl5,fonts,cups,qt4,groff,kde4,icons,pixmaps,emacs,gnome-background-properties,sounds,gnome,games,desktop-directories}"
EXCLUDEDIRS+=" "
EXCLUDEDIRS+="/var/*"
EXCLUDEDIRS+=" "
EXCLUDEDIRS+="/data/*"
EXCLUDEDIRS+=" "
EXCLUDEDIRS+="/opt/{code,goLibs,nodejs}"
EXCLUDEDIRS+=" "
EXCLUDEDIRS+="/opt/{code,goLibs,nodejs}"
EXCLUDEDIRS+=" "
EXCLUDEDIRS+="/root/{.vpython-root,tools,OpenMind,.cache,tools}"
EXCLUDEDIRS+=" "
EXCLUDEDIRS+="/tmp/*"
EXCLUDEDIRS+=" "
OPTIONS+="--numeric-owner"
OPTIONS+=" "
OPTIONS+="--exclude-backups"
OPTIONS+=" "
OPTIONS+="--exclude-caches-all"
OPTIONS+=" "
EXCLUDEFILES=`find /root/LIZHI/ -name core.[0-9]* -o -name *.log`
for ditem in $EXCLUDEDIRS ; do
OPTIONS+=" --exclude=$ditem "
done
for fitem in $EXCLUDEFILES ; do
OPTIONS+=" --exclude=$fitem "
done
echo "OPTIONS is $OPTIONS"
tar $OPTIONS -zcvf /mnt/CentOS7-BaseImage-$today.tar /root/LIZHI/rtc_media_sg/ /root/.bashrc /root/tools/node-v14.18.1-linux-x64/ /tmp /bin /boot /data /dev /etc /lib /lib64 /media /mnt /opt/ThirdParty/ /proc /run /sbin /srv /sys /usr /var
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Shell
1
https://gitee.com/dtrylzhm/mycommand.git
git@gitee.com:dtrylzhm/mycommand.git
dtrylzhm
mycommand
mycommand
master

搜索帮助