自动脚本忘写入cron
This commit is contained in:
parent
7a8ceb85ec
commit
8e81657f82
@ -109,7 +109,8 @@ EOF
|
||||
chmod +x "$path/backup.sh"
|
||||
|
||||
declare cron_job="${cron} ${path}/backup.sh"
|
||||
(crontab -l 2>/dev/null | grep -Fxq "${path}/backup.sh") || (crontab -l 2>/dev/null; echo "$cron_job") | sudo crontab -
|
||||
(crontab -l 2>/dev/null | grep -v "backup.sh") | sudo crontab -
|
||||
(crontab -l 2>/dev/null; echo "$cron_job") | sudo crontab -
|
||||
|
||||
sudo systemctl restart cron 2>> /dev/null || echo "自动任务重启失败"
|
||||
|
||||
|
@ -22,4 +22,9 @@ EOF
|
||||
esac
|
||||
|
||||
chmod +x "${path}/update.sh"
|
||||
|
||||
declare cron_job="${cron} ${path}/update.sh"
|
||||
(crontab -l 2>/dev/null | grep -v "update.sh") | sudo crontab -
|
||||
(crontab -l 2>/dev/null; echo "$cron_job") | sudo crontab -
|
||||
|
||||
sudo systemctl restart cron 2>> /dev/null || echo "自动任务重启失败"
|
@ -53,6 +53,11 @@ for dir in "\$web_path"/*/; do
|
||||
done
|
||||
EOF
|
||||
chmod +x "${path}/up-docker_compose.sh"
|
||||
|
||||
declare cron_job="${cron} ${path}/up-docker_compose.sh"
|
||||
(crontab -l 2>/dev/null | grep -v "up-docker_compose.sh") | sudo crontab -
|
||||
(crontab -l 2>/dev/null; echo "$cron_job") | sudo crontab -
|
||||
|
||||
sudo systemctl restart cron 2>> /dev/null || echo "自动任务重启失败"
|
||||
;;
|
||||
'4')
|
||||
|
Loading…
Reference in New Issue
Block a user