在root目录下创建run.sh脚本 vim run.sh # 文件内容如下 #!/bin/sh cd /home/crontab_backup git add . git commit -m "crontab备份" git push # 保存