【问题标题】:Scheduling Script with Crontab - SIGABRT internal error使用 Crontab 调度脚本 - SIGABRT 内部错误
【发布时间】:2016-08-05 12:12:12
【问题描述】:

我编写了一个包含phantomjs 的Shell 脚本,现在我希望它每天在特定时间运行。我使用了crontab,并编辑了调用后得到的文件

crontab -e

包括

56 13 * * * /home/lena/Str8ts_Project/str8ts2.bash

如果我手动运行脚本,它会正常工作,但是一旦安排好脚本,我就会收到标题为 phantomjs crashed with SIGABRT in GI_raise() 的 Ubuntu 错误消息。。 p>

显然 phantomjs 有问题,但我不知道它可能是什么。

我在联想 ThinkPad 上运行带有 Xfce 的 Ubuntu 16.04。

感谢您的帮助。

编辑:str8ts2.bash 的代码

!/bin/bash

### Create Image
phantomjs str8ts.js

### Crop and keep big image
#convert file_name.png -crop 414x419+318+712 cropped.png

###  Crop and discard big image
mogrify -crop 414x419+318+712 *.png

### change to directory for files and move png there
cd Str8tsFiles 
mv /home/lena/Str8ts_Project/*.png .

以及开头调用的单独的phantomjs文件str8ts.js

var currentTime = new Date();
currentTime = currentTime.toDateString();
currentTime = currentTime.replace(/\s+/g, '_');
var file_name = currentTime + "str8ts.png";

var page = require('webpage').create();
page.open('http://www.str8ts.de/', function() {
   page.render(file_name);
   phantom.exit();
});

【问题讨论】:

    标签: bash phantomjs crontab scheduling


    【解决方案1】:

    尝试以下方法:

    使用which 查找您的默认bash 位置

    which bash

    这将告诉您bash 的位置,例如/bin/bash

    在您的 crontab 条目中添加对 bash 的完整路径名调用(还要注意 -c)

    56 13 * * * /bin/bash -c /home/lena/Str8ts_Project/str8ts2.bash
    

    我们只是想消除bash(或不是)在您的crontab 条目中的问题。

    【讨论】:

    • 这给了我和以前一样的错误信息。但我想这意味着,问题出在 phantomjs 上,不是吗?
    猜你喜欢
    • 2018-01-26
    • 2012-06-01
    • 2012-06-10
    • 2019-11-14
    • 1970-01-01
    • 2018-06-26
    • 2019-12-19
    • 2013-10-04
    • 1970-01-01
    相关资源
    最近更新 更多