Crontab用于运行Octave脚本的语法

问题描述 投票:-1回答:1

基本的八度测试脚本,check_octave_crontab.m,是

## create some data
cd /path/to/the/required/octave/directory
x = [ 1 2 3 4 5 6 7 8 9 ] ;
dlmwrite( 'crontab_test_file' , x ) ;

和cronjob是

2,22,42 * * * 1-5 /usr/local/bin/octave '/home/path/to/this/octave/script/check_octave_crontab.m'

但未绘制任何图。

/ usr / local / bin / octave是一个共享库,它指向octave-5.1.0共享库,这是我从源代码编译的Octave的安装版本。我需要在crontab中进行哪些更改?

cron octave
1个回答
0
投票

这是因为在这种情况下没有DISPLAY。我使用[]从crontab运行脚本

xvfb-run -e /dev/stdout -a --server-args "-screen 0 1920x1080x24" /usr/local/bin/octave myscript.m
© www.soinside.com 2019 - 2024. All rights reserved.