crontab 执行脚本,报错/home/scripts/eyeMonitor.sh: line 8: node: command not found
报错现象:在shell下执行node没有任何问题,但crontab自动运行就会报错。

原因:node的安装路径:/root/.nvm/versions/node/v6.7.0/bin/node

Shell环境PATH变量中已配置,因此在shell下可以执行。
但要知道,我们这是在crontab下定时运行,因此需要检查crontab的环境变量。
[root@WEB4 node]# vim /etc/crontab
SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root
HOME=/ # For details see man crontabs # Example of job definition:
# .---------------- minute ( - )
# | .------------- hour ( - )
# | | .---------- day of month ( - )
# | | | .------- month ( - ) OR jan,feb,mar,apr ...
# | | | | .---- day of week ( - ) (Sunday= or ) OR sun,mon,tue,wed,thu,fri,sat
# | | | | |
# * * * * * user-name command to be executed
从上面的检查结果可以看出,node的path没有配置,此处增加下node的安装路径到PATH变量即可。
crontab 执行脚本,报错/home/scripts/eyeMonitor.sh: line 8: node: command not found的更多相关文章
- vmware安装minimal centos报错/etc/rc5.d/s99local : line:25 : eject : command not found
今天在用centos mini 版的时候创建虚拟机出现错误提示:vmware安装minimal centos报错/etc/rc5.d/s99local : line:25 : eject : comm ...
- /var/lib/zabbix/percona/scripts/get_mysql_stats_wrapper.sh: line 19: mysql: command not found
[root@test ~]# tail -f /tmp/zabbix_agentd.log /var/lib/zabbix/percona/scripts/get_mysql_stats_wrappe ...
- crontab执行python报错原因总结
1.相对路径导致 2.环境变量问题,py脚本首行应指定python路径,不能用软链接 3.python3.3是默认utf-8,需要 &&脚本 最好使用crontab -e ...
- win-sudo插件解决Git bash 执行脚本报错问题 bash: sudo: command not found
Windows git bash 默认没有sudo命令,可以添加win-sudo插件实现该功能 curl -s https://raw.githubusercontent.com/imachug/wi ...
- RabbitMq安装成功后执行命令报错(Error: unable to connect to node 'rabbit@DESKTOP-LPKSION': nodedown)
我们直接来看解决方案吧.首先打开服务,找到RabbitMq服务. 双击打开后选择登陆选项卡: 点选此账户,输入你计算机的登录名称.点击浏览: 在这里输入你的用户名,点检索: 这里的密码输入你电脑开机登 ...
- 【Selenium】【BugList4】执行pip报错:Fatal error in launcher: Unable to create process using '""D:\Program Files\Python36\python.exe"" "D:\Program Files\Python36\Scripts\pip.exe" '
环境信息: python版本:V3.6.4 安装路径:D:\Program Files\python36 环境变量PATH:D:\Program Files\Python36;D:\Program F ...
- oracle脚本执行多条语句报错
情况一: create table edu_group_parent ( group_id ) primary key not null, group_name ), group_url ), gro ...
- 执行mysqld_safe报错:mysqld does not exist or is not executable
执行mysqld_safe报错: [root@edu data]# /usr/local/mysql5.7/bin/mysqld_safe --user=mysql160427 12:41:28 my ...
- 数据库执行sql报错Got a packet bigger than 'max_allowed_packet' bytes及重启mysql
准备在mysql上使用数据库A,但mysql5经过重装后,上面的数据库已丢失,只得通过之前备份的A.sql重新生成数据库A. 1.执行sql报错 在执行A.sql的过程中,出现如下错误:Got a p ...
随机推荐
- L1-021 重要的话说三遍
这道超级简单的题目没有任何输入. 你只需要把这句很重要的话 —— “I'm gonna WIN!”——连续输出三遍就可以了. 注意每遍占一行,除了每行的回车不能有任何多余字符. 输入样例: 无 输出样 ...
- L229 词汇题
The incidence of lung cancer is particularly high among long-term heavy smokers,especially chain smo ...
- php 给对象动态增加属性 及子类继承父类的构造方法
<?php error_reporting(-1); ini_set('display_errors','on'); class A { public $a = 'hello'; public ...
- WTForms组件
WTForms组件 WTForms是一个支持多个web框架的form组件,主要用于对用户请求数据进行验证. 注意: from wtforms import Form 和 from flask_wtf ...
- C语言基础:函数指针 分类: iOS学习 c语言基础 2015-06-10 21:55 15人阅读 评论(0) 收藏
函数指针:指向函数的指针变量. 函数名相当于首地址. 函数指针定义:返回值类型 (*函数指针变量名)(参数类型1,参数类型2,....)=初始值 函数指针类型:返回值类型 (*)(参数类型1,参数 ...
- pip source
linux版本 sudo vim .pip/pip.conf[global]index-url = http://pypi.douban.com/simple[install]trusted-host ...
- Oracle Statistic 统计信息 小结
oraclestatisticstabledatabasesqldictionary 目录(?)[-] 直方图上列的信息说明 直方图类型说明 一. Statistic 说明 Oracle 官 ...
- 在U盘上安装Windows 7的详细步骤
买到苹果新款MacBook Air后大家最想干的事是什么?体验一下Mac OS X?事实告诉我们有几乎一半的人第一件想要做的事是装一个微软的Windows系统,但问题是新版的MBA已经没有光驱了,这可 ...
- 实验吧—隐写术——WP之 欢迎来到地狱
解压压缩包后出现三个文件.jpg .zip .docx 发现图片打开不显示,用winhex打开发现缺少文件头,将jpg的文件头补上 保存后图片可以打开 是一个百度网盘的链接,注意l和1的区别,网盘里是 ...
- 数据库表结构转成设计书,PowerDesigner 表格导出为excel
数据库中的表导入到PowerDesigner中并转为excel文档 1.打开PowerDesigner12,在菜单中按照如下方式进行操作 file->Reverse Engineer->D ...