我有一个脚本,这个脚本叫做shebang #!/usr/bin/env node。
当cron运行我的脚本时,我会得到这个错误/usr/bin/env: node: No such file or directory。
当我以用户身份运行脚本时,脚本运行得很好,只是不是以cron的身份运行。我猜是因为节点不在运行cron的用户的路径上吧?
我怎么才能让她和克伦一起工作?
$ which node给了我/home/myuser/.nvm/v0.11.14/bin/node
我的本地crontab文件中有以下计划:
*/10 * * * * /usr/local/bin/node /Users/harrisoncramer/CrontabScripts/dsca-arms-sales/xmlParser.js
它使用节点运行我的文件的本地副本。我也存储了这个数字海洋节点项目。但是,当我试图编写一个非常类似的时间表时,会出现以下错误:
"/tmp/crontab.Wf1279/crontab":0: bad minute
errors in crontab file, can't install.
Do you want to retry t
我已经为每天运行NodeJS脚本配置了一个cron任务。
crontab -l
# Edit this file to introduce tasks to be run by cron.
#
# Each task to run has to be defined through a single line
# indicating with different fields when the task will be run
# and what command to run for the task
#
# To define the time you can provide con
使用网站的指示:
我在MacOS X 10.9.5上安装了八度音阶。已安装的应用程序如下:
/Applications/Octave-cli.app
/应用程序/Octave-gui.app
现在,我有一个名为example.m的八度音阶脚本
%file: example.m
print('hello')
我如何从终端运行这个文件?
NOTE:
open /Applications/Octave-cli.app # this works fine
open /Applications/Octave-gui.app # this freezes the
在apt版本的octave中,我可以使用命令octave script.m来执行文件script.m。类似地,flatpak run org.octave.Octave script.m也能工作。
但是,为了避免长命令flatpak run org.octave.Octave,我创建了一个带有flatpak run org.octave.Octave内容的文件~.local/bin/octave,并将其标记为可执行文件(我已经删除了Octave的apt版本)。虽然它运行得很好,但octave script.m不再工作了,它只打开命令行版本的Octave。
我知道我可以打开Octave,并从内部
一年多以前,我编写了一个通知程序。(在Ubuntu16.04.7上),它用平放播放一些音频,然后用通知的文本设置一个yad窗口。这可以从命令行运行,也可以从cron运行。最近,我安装了Ubuntu20.04.3,发现从命令行运行仍然有效,但是运行cron不能。我在主目录下有一个bin目录,其中保存了脚本(remind.sh)。缩减后的remind.sh版本如下。注意,当我从cron运行时,我没有收到脚本已经运行的音频指示,但是trace.txt文件被更新了,并且yad生成了一个窗口。
#!/bin/bash
# reminder script called from either
#
如何为Windows构建可执行的Octave脚本,我不想要一个不需要Octave的独立可执行文件,只需要运行Octave的可执行脚本和双击文件后的脚本。
我试图创建这样一个.bat文件:
C:\(Octave full path)\bin\octave C:\(My m file full path)\pruebaoc.m
但我知道这个错误:
liboctgui-1.失踪
这很奇怪,因为Octave在我的电脑上工作得很好,如果我在CMD上手动写同样的行,它就能工作。