linux 的计划任务 cron
https://serverfault.com/questions/587696/how-to-restart-php-fpm-from-cron
我也遇到了这个问题,想用cron 来启动php-fpm进程(当检测到php-fpm 进程挂掉的时候)
#!/bin/bash
pid=`ps aux|grep php-fpm|grep -v grep|awk '{print $2}'`
if [[ $pid == '' ]]
then
service php5.6-fpm restart
fi
----------------------------------------------------
把service php5.6-fpm 这句改为 /etc/init.d/php5.6-fpm restart 就是可以的。也是够奇怪的。:)
------------------------------------------------------------------------------
I'm trying to restart PHP5-FPM periodically using Cron, but am having no luck.
I can restart manually with no problems, using service php5-fpm restart or /usr/sbin/service php5-fpm restart
However, when I use the same command, including using the full path to /usr/sbin/service, nothing happens. The cronjob does run (as I see from the syslog), but PHP5-FPM does not restart.
The relevant line of my root user's crontab looks as follows:
* * * * * /usr/sbin/service php5-fpm restart
I have confirmed with which service that the path to service is indeed /usr/sbin/service.
Why is this not working?
linux 的计划任务 cron的更多相关文章
- linux任务计划cron
linux任务计划cron 1.crontab命令任务计划配置文件 [root@bogon ~]# cat /etc/crontab SHELL=/bin/bash PATH=/sbin:/bin:/ ...
- linux任务计划cron、chkconfig工具、systemd管理服务、unit和target介绍
第8周第1次课(5月14日) 课程内容: 10.23 linux任务计划cron10.24 chkconfig工具10.25 systemd管理服务10.26 unit介绍10.27 target介绍 ...
- Linux centos7 linux任务计划cron、chkconfig工具、systemd管理服务、unit介绍、 target介绍
一.linux任务计划cron crontab -u -e -l -r 格式;分 时 日 月 周 user command 文件/var/spool/corn/username 分范围0-59,时范 ...
- linux的服务管理(centos6和Centos7)和网络管理(网卡配置),计划服务cron
服务和网络 管理 init ifcfg ens33 1.服务: Linux系统中提供的功能,统称为服务,如:at服务.cron服务.web服务.FTP服务.sshd服务等. 服务是由已经在运行的进程 ...
- Linux任务计划
Linux任务计划: 一次性任务执行(at.batch): at:定时任务,指定一个时间执行一个任务,只能执行一次. at使用方式: 交互式:让用户在at>提示符输入多个要执行的命令: 批处理: ...
- 配置Linux任务计划
Linux有三种计划任务: at:指定一个时间执行一个任务 (适用一个或多个任务,执行一次后就不用) cron:根据一个时间表自动执行任务 (使用一个或多个任务,周期性执行) 系统级别的计划任务及其扩 ...
- Linux操作系统计划任务
++++++++++++++++++++++++++++++++++++++++++++++++标题:Linux操作系统的计划任务内容:计划任务分为单次任务和周期性任务,周期任务分为系统级计划任务和用 ...
- Linux中计划任务、周期性任务设置
Linux中计划任务.周期性任务设置 计划任务:指在未来的特定时间里,执行一次某一特定任务.当然,如果同一任务需要在不同时间点执行执行两次.三次或多次,可以视为多个一次看待. 周期性任务:指某一任务需 ...
- Linux定时任务计划
Linux定时任务计划 在使用Linux系统时,我们有时会需要让系统在某个时间去执行特定的任务,这时就需要去了解Linux提供的定时任务功能 种类 Linux的定时任务分为两种:单一型和循环型 单一型 ...
随机推荐
- Ubuntu 16.04 apt-get搭建LAMP环境
本文重点介绍在Ubuntu中使用apt-get安装LAMP(Ubuntu 16.04,Apache2.4.18,mysql5.7.12,php7.0.4)环境,所以不再介绍如何安装Ubuntu. 安装 ...
- 走进 Akka.NET
官方文档:https://getakka.net/index.html 官网:https://petabridge.com/ 一.Akka.NET 是什么? Akka 是一个构建高并发.分布式和弹性消 ...
- js里给变量拼接双引号
先来看一下最终效果: 但是p标签是要用js生成的.data_attr自定义属性值是一个变量. var data='qq289483936'; var p='<p data_attr='+data ...
- 深入理解String.intern()方法
首先进入intern()的源码中, 首先说一点:1.7后的JVM为String在方法区中开辟了一个字符串常量池,如果一个String()不是new()出来的,都将在常量池中拿字符. 注释翻译过来就是, ...
- bzoj 2938 AC自动机 + dfs判环
#include<bits/stdc++.h> #define LL long long #define ll long long #define fi first #define se ...
- C/C++宏的用法
今天看caffe源码的时候看到了很多宏定义的内容,苦于代码基础薄弱,无法全部理解,故在网上搜得此篇好文,转载一发附原文地址:http://blog.csdn.net/hanchaoman/articl ...
- 2017江苏省省赛 Roads(全局最小割)
Roads 时间限制: 2 Sec 内存限制: 256 MB提交: 6 解决: 2[提交][状态][讨论版] 题目描述 In ICPCCamp, there are n towns conveni ...
- Flask实战第55天:cms轮播图上传到七牛功能完成
登录七牛云,进入“对象存储”, 新建存储空间(Bucket), 我创建的空间命名为flask-bbs 创建完Bucket,七牛会给我们提供一个测试域名,生产环境中,我们需要绑定自己的域名 在个人面板中 ...
- HDU 6336 Matrix from Arrays
Problem E. Matrix from Arrays Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 262144/262144 ...
- python--flask框架的安装和简单使用(转)
原文地址:http://blog.csdn.net/xiaowu8858892520/article/details/54428196