Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

自动备份到github的功能好像过一段时间就会失效。 #116

Open
okoklai opened this issue Nov 4, 2024 · 5 comments
Open

自动备份到github的功能好像过一段时间就会失效。 #116

okoklai opened this issue Nov 4, 2024 · 5 comments

Comments

@okoklai
Copy link

okoklai commented Nov 4, 2024

每天4点自动备份到github在探针搭建完成后过一段时间就不自动备份了。将readme文件手动改成backup也不会备份。此时进行容器中手动运行/dashboard/backup.sh是可以备份到github中的。

请问一下如何查看备份过程日志,以便分析一下是什么原因导致无法自动备份?

@fscarmen2
Copy link
Owner

  1. 看看平台的日志,看容器有没有停。

  2. 添加运行备份脚本时间的日志

在这下面插入一句,这个意思是每次运行的时候,记录当前的时间到 /tmp/log,过几天看看该文件的运行时间。

echo "$(date "+%Y-%m-%d-%H:%M:%S")" >> /tmp/log
image

@okoklai
Copy link
Author

okoklai commented Nov 5, 2024

1、容器是运行在自己的VPS上的,应该不存在暂停的问题
2、按要求将编辑了backup.sh以便将脚本运行时间记录到/tmp/log,手动运行backup.sh查看/tmp/log能看到脚本的运行时间。
image

3、手动运行脚本日志截屏如下(从日志上来看,似乎VPS到github的网络连接不畅备份失败了)
Snipaste_2024-11-05_11-15-37

4、后面再次运行bash backup.sh,提示备份成功,日志截屏如图
image

@okoklai
Copy link
Author

okoklai commented Nov 5, 2024

将readme改成backup后,并等待10分钟。/tmp/log中并没有出现脚本运行时间的记录。是不是说明backup.sh压根没有运行?那么要从哪几个方面去排查?

@fscarmen2
Copy link
Owner

我看不明,为什么第1次你手动运不成功,第2次却成功。好像是系统资源的问题,与github连接没有问题。

至于readme.md,你手动运行 bash -x restore.sh

@okoklai
Copy link
Author

okoklai commented Nov 6, 2024

我看不明,为什么第1次你手动运不成功,第2次却成功。好像是系统资源的问题,与github连接没有问题。

至于readme.md,你手动运行 bash -x restore.sh

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants