cpanel cron git推动不起作用



我在脚本中具有此命令,然后通过cpanel cron运行。

#!/bin/bash
cd /home/somesite/public_html && git add . && git commit -m "Backup `date +%d%m%Y_%H%M`" && git push;

在日志中,我得到以下响应:

[master 06b7cb4] Backup 12032017_2221
 2 files changed, 107 insertions(+), 147 deletions(-)
Permission denied (publickey).
fatal: The remote end hung up unexpectedly

如果我在终端上运行相同的命令是可以的

我认为这将帮助您实现自己想要的东西:

https://alvinabad.wordpress.com/2013/03/23/how-to-specify-an-ssh-key-file-file-with-with-the-git-command/

然后,您只需要调整应该在Cron作业中运行的bash脚本

最新更新