小编blu*_*xer的帖子

Node.js脚本的Workload Scheduler - 它是否等同于Bluemix中的cron作业?

我node file.js每天早上都想用Bluemix Workload Scheduler 打电话; file.js在我的node.js项目的根目录中; file.js不是我的服务器文件.我曾经使用过cron,但似乎"BlueMix没有cron作业的概念."

作为我的过程的(仅)步骤的结果,我得到"node:command not found"

我想我错过了什么.是否可以使用Workload Scheduler执行此操作,还是应该找到其他选项?

更多信息

我正在尝试:

var wls = new WorkloadService(credentials);

var wp = new WAProcess("MyProcessName", "DescriptionProcess");
wp.addStep(new CommandStep("node file.js", myAgentName));
wp.addTrigger( TriggerFactory.repeatDaily(1) );

wls.createAndEnableTask(wp, function(res){
    wls.runTask(res.id, function(){console.log("Process is created and started.")});
});
Run Code Online (Sandbox Code Playgroud)

我可以在"IBM Workload Automation on Cloud - Application Lab"中看到该过程已创建并启动.几个后来,进程失败说"未找到节点命令"

我想我在文档中读到代理只能调用本地系统命令(例如cat,pwd ...)或与外部交互的命令(用于REST服务调用).所以它无法找到node命令或file.js.

除非我在代理上安装所有东西?文档说我们可以/home/wauser/workspace使用curl命令在目录中安装程序.那我该怎么办?

scheduler node.js ibm-cloud

6
推荐指数
1
解决办法
604
查看次数

标签 统计

ibm-cloud ×1

node.js ×1

scheduler ×1