[modify] rewrite backups.sh, add dash logo change, and change the start program of calibre

This commit is contained in:
2023-06-08 10:02:29 +08:00
parent 66b1dd4d70
commit 3956206c45
3 changed files with 6 additions and 6 deletions

View File

@ -14,7 +14,7 @@ cp -rf /etc/apt/sources.list /opt/configs/conf/
cp -rf /root/.acme.sh/*ecc /opt/configs/acme/
cd /opt && t=`date +%Y%m%dT%H%M%S`
rsync -av apps configs logs scripts websites wd/72-Backups/CrossChain/VPS/ > /opt/logs/rsync/rsync_${t}.log
rsync -av --delete apps configs logs scripts websites wd/72-Backups/CrossChain/VPS/ > /opt/logs/rsync/rsync_${t}.log
cd /opt/logs/rsync/
let count=`ls | wc -l`
if [[ $count -gt 10 ]]; then

View File

@ -1,7 +1,8 @@
#!/bin/bash
calibre='/opt/apps/calibre/calibre-web-0.6.20'
# get the pid of calibre, and write it into file /tmp/calibre_pids
ps -ef | grep '/opt/apps/calibre/venv/bin/cps' | grep -v grep | awk '{print $2}' > /tmp/calibre_pids
ps -ef | grep "$calibre/cps.py" | grep -v grep | awk '{print $2}' > /tmp/calibre_pids
# if not exist, signifying that there is no calibre process
if [[ ! -s /tmp/calibre_pids ]]; then
@ -12,6 +13,6 @@ else
done
fi
nohup /opt/apps/calibre/venv/bin/python /opt/apps/calibre/venv/bin/cps > /dev/null 2>&1 &
nohup $calibre/venv/bin/python $calibre/cps.py > /dev/null 2>&1 &
echo -e "\e[1;32mCalibre process started successfully\e[0m"

View File

@ -2,7 +2,7 @@
# 设置图片数量和输出文件名
IMAGE_NUM_ALL=`ls /opt/apps/localcr/A_dashboard/local/icons | wc -l`
IMAGE_NUM_NEEDED=`cat /root/services.yaml | grep -E '[0-9]{1,3}.jpg' | wc -l`
IMAGE_NUM_NEEDED=`cat /opt/apps/localcr/A_dashboard/local/config/services.yaml | grep -E '[0-9]{1,3}.jpg' | wc -l`
if [[ $IMAGE_NUM_NEEDED -gt $IMAGE_NUM_ALL ]]; then
alarm='Dashboard:\nThere is NOT enough logos to use, please check ASAP.'
bash /opt/scripts/alert/sendmsg.sh "$alarm"
@ -39,8 +39,6 @@ done
# 需要修改的文件的路径和名称
filename_origin="/opt/apps/localcr/A_dashboard/local/config/services.yaml"
filename_copy="/opt/apps/localcr/A_dashboard/local/config/services_copy.yaml"
# filename_origin="/root/services.yaml"
# filename_copy="/root/services_copy.yaml"
cp $filename_origin $filename_copy
# 循环处理所有符合指定模式的行
@ -52,6 +50,7 @@ while read line; do
if [[ $oldname != '' ]]; then
newname=${arr[$count]}
# echo $newname = $oldname
# 替换文件名
sed -i "${lineno}s/\/$oldname/\/$newname/" $filename_origin
let count=count+1