1. 注册git.oschina
  2. 添加公钥
  1. 创建私有项目
  2. 下载脚本到服务器
  • git config --global user.name "你的名字或昵称"
  • 修改脚本配置
  • chmod +x backup.sh #赋予权限
  • ./backup.sh
  1. 使用 cron 设置定时脚本
  • crontab -e
  • 加入 30 3 * * * /bin/bash /root/backup.sh
  • 重启cron sudo service cron restart

完工