自动脚本时间问题

This commit is contained in:
lsy 2024-09-12 11:16:10 +08:00
parent 24de264de1
commit c84211da77
2 changed files with 4 additions and 5 deletions

View File

@ -1,7 +1,7 @@
#!/bin/bash
declare path=$1
declare cron=$2
declare path="$1"
declare cron="$2"
declare web_path
declare local_pick
declare baidu_pick
@ -92,7 +92,6 @@ chmod +x "$path/backup.sh"
declare cron_job="${cron} ${path}/backup.sh"
(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 "自动任务重启失败"

View File

@ -1,5 +1,5 @@
declare path=$1
declare cron=$2
declare path="$1"
declare cron="$2"
if [[ -f "${path}/update.sh" ]];then
echo "该路径文件已经存在"