hugo 定时推送代码前言提前配置好 git 仓库,配置好 ssh,该脚本是在 ssh 配置完成下编写,不然要输入用户名和密码实操新建 sh 文件,内容如下1 2 3 4 5 6 7 cd /root/hugo hugo cd /root/hugo/public git add . git commit -m "auto commit: $(date +'%Y-%m-%d %H:%M:%S')" git push origin main sudo nohup sh /root/shell/hugo.sh start &>> /root/shell/shell.log & 宝塔创建计划任务宝塔定时执行脚本即可可以手动执行,测试脚本