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. ...
随机推荐
- 功能强大的web打印控件lodop的使用
打印是很多web系统都需要的功能,最近找到一款功能强大,使用简单,价格便宜的web打印工具Lodop,免费也能用,不过有水印,也不贵商业开发建议购买. 废话不多说,拿来就用,从简单的打印开始. 1.下 ...
- 服务器ssh登录提示“Permission denied, please try
原因:不用怀疑,一般情况下,就是你密码输入错误了. 解决:找到正确的密码输入. 当然,也有可能是下面的情况: 在Windows中使用ssh客户端连接,提示"ssh服务器拒绝了密码,请再试一次 ...
- 反人类的MyEclipse之-Javascript双引号自动补全
MyEclipse由于在JavaScript中按下一个双引号后会自动把后面的双引号补全.本人习惯两个双引号一起按下,那么这个时候在编辑器里就会出现三个",这样导致代码错误. 今天就因为MyE ...
- Apache配置文件服务器
配置Apache文件服务器: apache配置文件服务器httpd.conf中这两个模块必须不被注释LoadModule autoindex_module modules/mod_autoindex. ...
- 跨平台编程:关于VS和QT那些事
1.Win平台 Qt5.7 for Win32 (VS2013) 编辑器:Qt Creator 4.0 编译器:MSVC12 for X86 (cl.exe&link.exe) 调试器:CDB ...
- JQuery easyui Datagrid 分页事件
easyui是Jquery中的一个轻量级UI插件,提供了一些诸如window.datagrid.button等控件.现在主要说说Datagrid中分页控件的使用. easyui中可以单独添加分页pag ...
- 2、NASA HS3(Hurricane AND Server Storm Sentinel)
国内访问不到,但是通过ppt可以看到,数据支撑做的很到位,前台展示很炫. 气象领域WebGL应用最好案例的当之无愧啊.这篇全部贴图了. 来自为知笔记(Wiz)
- Maven如何添加Oracle驱动包到本地仓库中
2016-05-28 http://note.youdao.com/yws/public/redirect/share?id=54cbe79c8948113ef492f946f7e027c8& ...
- ant 介绍 http://blog.csdn.net/sunjavaduke/archive/2007/03/08/1523819.aspx
转自: 本内容包含了Ant的历史简要介绍,Ant的功能以及Ant框架的介绍,并对下载安装使用Ant进行了示例介绍,同时通过一个Java程序讲解了Ant的基本使用方法. 1. Ant简介:这 ...
- Linux 显示文件完整路径
原链接 http://blog.chinaunix.net/uid-25266990-id-3268759.html ls foo | sed "s:^:`pwd`/:"