在这里写了很多篇linux,习惯了在这里写

centos中定时任务命令是crond

ubuntu中定时任务命令是cron

这两种linux系统不一样的地方还是挺多的,

既然我目前的专注点是ubuntu,所以centos就放下

-----

date -s 17:39:50 在centos中能对当前时间继续修改

但是在ubuntu中不行

-----

root@ubuntuE:/home/sophie# crontab -e

no crontab for root - using an empty one
Select an editor.  To change later, run 'select-editor'.
  1. /bin/ed
  2. /bin/nano        <---- easiest
  3. /usr/bin/vim.gtk
  4. /usr/bin/vim.tiny
date +%y%m%d
-->160630
date +%Y%m%d
-->20160630

----------------

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使用 服务的更多相关文章

  1. Ubuntu TFTP 服务

    /******************************************************************** * Ubuntu TFTP 服务 * 说明: * 在Ubun ...

  2. 解决Ubuntu MySQL服务无法远程登录

    一.10061错误 Ubuntu安装MySQL . sudo apt-get install mysql-server . apt-get isntall mysql-client . sudo ap ...

  3. Ubuntu ssh服务安装

    在使用xshell连接ubuntu虚拟机时,提示 Could not connect to '192.168.0.106' (port 22): Connection failed. 在主机使用pin ...

  4. Linux神器之Strace的实践(Ubuntu上服务幽灵般的消失)

    不论是运维,还是开发,面对Linux系统,时常会因为配置参数或者系统的权限(iptables限制端口,selinux拦截,文件目录权限等)原因出现程序或者服务异常,无法启动等等.特别是在Linux的文 ...

  5. 【Linux】Ubuntu配置服务自启动 sysv-rc-conf

    在Ubuntu下,配置服务系统开机自启动,使用的不是chkconfig,而是sysv-rc-conf. 且看如下: 安装: sudo apt-get install sysv-rc-conf 帮助信息 ...

  6. Ubuntu:系统启动服务

    系统启动服务 针对Ubuntu 5级别服务的说明 安装sysv-rc-conf sudo apt-get install sysv-rc-conf acpi-support 高级电源管理支持 acpi ...

  7. Ubuntu ssh 服务

    安装ssh-serversudo apt-get install openssh-server安装ssh-clientsudo apt-get install openssh-client 修改ssh ...

  8. Ubuntu Tftpd服务配置

    ---恢复内容开始--- 服务器端(ip:192.168.1.100) #安装tftpd-hpa sudo apt-get install tftpd-hpa 修改配置文件 sudo vim /etc ...

  9. Ubuntu自定义服务

    1.准备脚本 准备好一个bash服务脚本,包括start|stop|restart等参数,将脚本文件命名为“服务名”,拷贝到/etc/init.d/目录下. 2.添加服务sudo update-rc. ...

随机推荐

  1. 从零开始系列--R语言基础学习笔记之一 环境搭建

    R是免费开源的软件,具有强大的数据处理和绘图等功能.下面是R开发环境的搭建过程. 一.点击网址 https://www.r-project.org/ ,进入"The R Project fo ...

  2. Ejabberd 插件开发 --- IQ截获与处理

    ejabberd的组件开发其实是非常简单的,只要遵循其gen_mod规范,添加iq处理函数就可以了.下面一步步教大家如何开发ejabberd组件. 首先,最好是自己编译ejabberd源码,这样的话把 ...

  3. GPUImage实现摄像头暂停

    GPUImage相信很多开发者都用过,其本身也是十分简单易用,因此对于GPUImage的基本用法不再赘述. 最近在使用GPUImage时要实现摄像时暂停和继续的功能,但GPUImage本身并没有提供相 ...

  4. extentreports报告插件之extentX之服务搭建(三)

    之前两个章节已经写完再extentreports报告插件与testng 的集成,但是发现 每次测试完后,生成的报告都要在单独发送,每个项目都有一份报告,如果项目多的话,管理起来就会很冗余. 这个给大家 ...

  5. 向架构师进军-->可重用架构资源

    如果你对项目管理.系统架构有兴趣,请加微信订阅号"softjg",加入这个PM.架构师的大家庭 软件架构有三个主要来源:拿取.方法以及直觉.拿取也就是可重用资源.对于一个标准的系统 ...

  6. Java集合类简单总结(重学)

    java集合类简介(重学) 一.Collection(集合).Map接口两者应该是平行关系吧. 1.Map介绍 Map是以键值(key-value)对来存放的,2个值.通过key来找到value(例: ...

  7. java反射,ReflectUtils

    public class ReflectUtils { /** * 通过构造函数实例化对象 * @param className 类的全路径名称 * @param parameterTypes 参数类 ...

  8. texy

    网络组件 WebView注册代码 <uses-permission android:name ="android.permission.INTERNET" /> 解释网 ...

  9. JAVA 通过LDAP获取AD域用户及组织信息

    因为工作需求近期做过一个从客户AD域获取数据实现单点登录的功能,在此整理分享. 前提:用户可能有很多系统的情况下,为了方便账号的统一管理使用AD域验证登录,所以不需要我们的系统登录,就需要获取用户的A ...

  10. 提权GrantPrivilege

    大概一个多月前学习了提权的知识,当时一直不知道提权到底具体是为了干什么.只是模糊的知道提高权限,获得别的进程的一些东西.后来慢慢的学习的多了,知道了一个叫做ReadProcessMemory的函数,第 ...