ubuntu使用 服务
在这里写了很多篇linux,习惯了在这里写
centos中定时任务命令是crond
ubuntu中定时任务命令是cron
这两种linux系统不一样的地方还是挺多的,
既然我目前的专注点是ubuntu,所以centos就放下
-----
date -s 17:39:50 在centos中能对当前时间继续修改
但是在ubuntu中不行
-----
root@ubuntuE:/home/sophie# crontab -e
----------------
ubuntu 没有 centos中的 /var/log/crond
解决方法
http://askubuntu.com/questions/56683/where-is-the-cron-crontab-log
On a default installation the cron jobs get logged to
/var/log/syslog
You can see just cron jobs in that logfile by running
grep CRON /var/log/syslog
If you haven't reconfigured anything,the entries will be in there.
-----or
You can create a cron.log file to contain just the CRON entries that show up in syslog. Note that CRON jobs will still show up in syslog if you follow the following directions.
Open the file
/etc/rsyslog.d/50-default.conf
Find the line that starts with:
#cron.*
uncomment that line, save the file, and restart rsyslog:
sudo service rsyslog restart
You should now see a cron log file here:
/var/log/cron.log
Cron activity will now be logged to this file (in addition to syslog).
Note that in cron.log you will see entries for when cron ran scripts in /etc/cron.hourly, cron.daily, etc. - e.g. something like:
Apr 12 14:17:01 cd CRON[14368]: (root) CMD ( cd / && run-parts --report /etc/cron.hourly)
However, you will not see more information about what scripts were actually ran inside /etc/cron.daily or /etc/cron.hourly, unless those scripts direct output to the cron.log (or perhaps to some other log file).
If you want to verify if a crontab is running and not have to search for it in cron.log or syslog, create a crontab that redirects output to a log file of your choice - something like:
01 14 * * * /home/joe/myscript >> /home/log/myscript.log 2>&1
This will redirect all standard output and errors that may be produced by the script that is run to the log file specified.
ubuntu使用 服务的更多相关文章
- Ubuntu TFTP 服务
/******************************************************************** * Ubuntu TFTP 服务 * 说明: * 在Ubun ...
- 解决Ubuntu MySQL服务无法远程登录
一.10061错误 Ubuntu安装MySQL . sudo apt-get install mysql-server . apt-get isntall mysql-client . sudo ap ...
- Ubuntu ssh服务安装
在使用xshell连接ubuntu虚拟机时,提示 Could not connect to '192.168.0.106' (port 22): Connection failed. 在主机使用pin ...
- Linux神器之Strace的实践(Ubuntu上服务幽灵般的消失)
不论是运维,还是开发,面对Linux系统,时常会因为配置参数或者系统的权限(iptables限制端口,selinux拦截,文件目录权限等)原因出现程序或者服务异常,无法启动等等.特别是在Linux的文 ...
- 【Linux】Ubuntu配置服务自启动 sysv-rc-conf
在Ubuntu下,配置服务系统开机自启动,使用的不是chkconfig,而是sysv-rc-conf. 且看如下: 安装: sudo apt-get install sysv-rc-conf 帮助信息 ...
- Ubuntu:系统启动服务
系统启动服务 针对Ubuntu 5级别服务的说明 安装sysv-rc-conf sudo apt-get install sysv-rc-conf acpi-support 高级电源管理支持 acpi ...
- Ubuntu ssh 服务
安装ssh-serversudo apt-get install openssh-server安装ssh-clientsudo apt-get install openssh-client 修改ssh ...
- Ubuntu Tftpd服务配置
---恢复内容开始--- 服务器端(ip:192.168.1.100) #安装tftpd-hpa sudo apt-get install tftpd-hpa 修改配置文件 sudo vim /etc ...
- Ubuntu自定义服务
1.准备脚本 准备好一个bash服务脚本,包括start|stop|restart等参数,将脚本文件命名为“服务名”,拷贝到/etc/init.d/目录下. 2.添加服务sudo update-rc. ...
随机推荐
- js对话框5秒自动消失
使用了easyui的对话框控件 <html> <head> <title>5秒后关闭对话框</title> <meta http-equiv=&q ...
- Android高手速成
第一部分 个性化控件(View) http://www.cnblogs.com/huwei0814/p/3796659.html 第二部分 工具库 http://www.cnblogs.c ...
- SOCKET 服务器停止服务时清理连接操作
刚想到一个情况,正好是工作中遇到的. 当服务器停止时,正好有连接的请求正在被处理,而此时服务端需要等待该请求被正常的处理完,然后给客户端发送响应报文. 正常情况下,服务器停止的时候,是希望发送了响应报 ...
- The project: project which is referenced by the classpath, does not exist.
有个java工程运行时报The project: project which is referenced by the classpath, does not exist.错误 上网查解决方案,说是将 ...
- 【转载】Delphi7从子线程中发送消息到主线程触发事件执行
在对数据库的操作时,有时要用一个子线程来进行后台的数据操作.比如说数据备份,转档什么的.在主窗口还能同是进行其它操作.而有时后台每处理一个数据文件,要向主窗口发送消息,让主窗口实时显示处理进度在窗口上 ...
- SQL Server 2014 SP2发布下载:数十项更新修复
微软发布了数据库工具SQL Server 2014 SP2服务包下载,本次更新集合了数十项更新修复,涉及安全和功能性补丁,使用SQL Server 2014的用户应该及时安装该服务包. 文件内容 版本 ...
- tomcat8和7关于自定义tag的处理区别
今天将一直运行在tomcat-7.0.29(jdk1.6)上的应用迁移到tomcat-8.0.26(jdk1.7)上面,老显示如下错误: org.apache.jasper.JasperExcepti ...
- IIS7下ajax报未定义错误
项目之前在iis6环境下运行的很好,今天在WIN7下发布,结果居然报对象未定义错误,经过个把小时折腾,终于弄清楚原委. 在web.config中关于AjaxPro的设置,在IIS7.0(WIN7中使用 ...
- CentOS 7虚拟机下模拟实现nginx负载均衡
以CentOS 7为例,我们模拟实现nginx来处理静态资源,apache来处理php 1.首先我们来安装nginx # wget http://nginx.org/packages/centos/ ...
- Java中的闪光点:ThreadLocal是线程Thead的局部变量,可替代同步机制的设计,值得学习和研究
线程局部变量ThreadLocal,是Java支持的一种线程安全机制,目的是解决多线程的并发问题. 具体来讲,就是多个线程访问该实例对象的变量时,该实例对象将其存储为键值对的形式,保证各个线程(键)分 ...