Cronjob无法在Google Compute Engine上运行

Qui*_*r27 5 cron google-app-engine crontab google-compute-engine

我在Google Cloud的计算引擎实例中设置了一个cron作业.

假设每天早上7:47运行.但是每次我检查文件是否在7:48执行时都不起作用.

在此输入图像描述

helloworld.sh文件的代码在这里

echo "helloworld" + "$(date)" > helloworld.txt
Run Code Online (Sandbox Code Playgroud)

我已将root设置为root,并将root作为root用户设置为cron作业.有任何想法吗?

Ale*_*uie 1

cron 作业是错误的,因为您需要在命令中使用绝对路径。尝试:

/bin/bash /home/username/helloworld.sh
Run Code Online (Sandbox Code Playgroud)