0
0
This commit is contained in:
whoami 2024-04-30 20:50:25 +08:00
parent 7a2aa0ddc1
commit 47fba234f4

31
auto-upload.md Normal file
View File

@ -0,0 +1,31 @@
crontab 配置文件(每 20min 上传一次):
```text
*/20 * * * * [脚本绝对路径]
```
脚本文件(记得调权限为 7xx
```shell
#!/bin/bash
source /etc/profile
cd /root
/usr/bin/git clone [仓库链接]
cd [仓库目录]
/usr/bin/git checkout [分支名]
/usr/bin/cp [测号器输出目录]/* .
/usr/bin/git add .
/usr/bin/git commit -m "auto commit"
/usr/bin/git push origin [分支名]
cd ..
/usr/bin/rm -rf [仓库目录]
```
使用前先上传 ssh 私钥并调权限,然后执行以下命令:
```shell
apt update && apt install cron
service cron start
crontab [配置文件]
```