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. ...
随机推荐
- git如何设置账号密码
查看已设配置 git config --list 修改GIT全局用户名 git config --global user.name [username] 修改GIT全局邮箱 git config -- ...
- mysql 5.7.11 yum 安装步骤
直接上步骤 首先你得有一台能够上外网的linux服务器 1:rpm -Uvh http://dev.mysql.com/get/mysql-community-release-el6-5.noarch ...
- Maven私有仓库搭建和使用
下载和安装 下载地址: http://www.sonatype.com/nexus-repository-oss 安装: Linux版的无需安装,直接解压即可,然后进入bin目录下,运行./nexus ...
- 用delphi实现rar文件的解压的方法
http://blog.csdn.net/ad_home/article/details/2818936 准备工作 下载winrar提供的动态链接库unrar.dll http://w ...
- iOS开发 - OC - 苹果为大家提供的后台:CloudKit 的简单使用
一.什么是cloudKit 移动开发中,网络请求数据是日常中用到的,我们习惯把一些用户改动的数据存在服务器,以便下次请求使用.或者开发者方通过服务器将编辑的数据发送给用户.但是这一切都建立在我们的AP ...
- mysql下将分隔字符串转换为数组
MySQL存储过程可以用于分割字符串,下面就为您详细介绍这种MySQL存储过程的用法,供您参考学习之用. 现有一段字符串,如apple,banana,orange,pears,grape,要把它按照逗 ...
- (转)C语言_测试程序运行内存状态GlobalMemoryStatus使用案例
在做毕业设计的时候,需要验证算法的空间复杂度,C语言网上都说是用GlobalMemoryStatus这个函数,但是网上却没有这个函数的使用实例,也有人说是用内存分析器的东西,但是这个显然是不靠谱的. ...
- win7远程桌面恢复全屏状态快捷键
不同的电脑可能有不同的快捷键(有些笔记本电脑甚至没有相应的键值):①台式机:ctrl+alt+break 组合键.②CTRL+ALT+PAGEDOWN 组合键.③有的笔记本没有break键,可以尝试加 ...
- sqlldr
1.字符集 sqlldr可以指定读取的文件的字符集,如果数据库为gbk,读取的文件为utf-8,这个时候就需要指定字符集 load data CHARACTERSET 'UTF8' 2.sqlldr导 ...
- 巧用freemarker
使用Freemarker宏进行可扩展式模块化编程 该文是转载而来,并非我本人所写,但是觉得真心不错,所以收藏一下 一.前言 今天的文章聊一下freemarker的一些特性:宏,我们将使用它写出一些模块 ...