docker(ubuntu)中安装cron运行crontab定时任务

1.安装cron

apt-get install cron

设置crontab定时任务

crontab -e

*/1 * * * * /usr/bin/python /python/asch-check.py

编辑输入以上(表示1分钟执行一次asch-check.py脚本)

启动:
service cron start

2.安装日志服务rsyslog

apt-get install rsyslog

启动

service rsyslog start

编辑设置

vi /etc/rsyslog.d/50-default.conf

cron.*              /var/log/cron.log #将cron前面的注释符去掉

重启

service rsyslog restart

3.重新启动cron

重新启动

service cron restart

4.查看cron运行任务和日志:

crontab -l #查看定时任务

等到时间到了之后,发现定时任务未执行

tail -f /var/log/cron.log  查看日志

原文地址:https://www.cnblogs.com/007sx/p/11263486.html

时间: 2024-07-30 07:42:08

docker(ubuntu)中安装cron运行crontab定时任务的相关文章

Ubuntu中安装eclipse,运行出错处理

在Ubuntu中安装eclipse sudo apt-get install eclipse-cdt eclipse 安装完成后,启动程序时出现错误框: An error has occurred. See the log file/home/GOOD/.eclipse/org.eclipse.platform_3.7.0_155965261/configuration/1417143109545.log. 打开文件发现错误信息: !ENTRY org.eclipse.osgi 4 0 2014

在Ubuntu中安装Docker和docker的使用

1.在Ubuntu中安装Docker 更新ubuntu的apt源索引 sudo apt-get update 安装包允许apt通过HTTPS使用仓库 sudo apt-get install apt-transport-https ca-certificates curl software-properties-common 添加Docker官方GPG key curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-k

在Ubuntu中安装Docker

前言 网上已经有很多介绍Docker安装的文章,自己的安装过程记录一下,为了博客文章结构的连贯性,为写下一篇R和Docker的相遇做为环境基础,同时也给自己一个备忘. 目录 Docker是什么? 在Linux Ubuntu中安装Docker Docker镜像仓库 制作自己的Docker镜像 上传Docker镜像到公共仓库 完整文章:http://blog.fens.me/linux-docker-install/

linux中安装wine运行windows程序

http://blog.csdn.net/pipisorry/article/details/41653361 Wine的介绍 Wine是Wine Is Not an Emulator(Wine不是模拟器)的缩写,其实是一个转换层(或程序装入器),能够在Linux及与POSIX兼容的其他类似操作系统上运行Windows应用程序.Wine在Linux上无法模拟Windows应用程序,而是提供了另外的方法来实施DLL(典型的Windows应用程序可以调用这些DLL)和代替Windows NT内核的进

在Ubuntu中安装Redis

原文地址:http://blog.fens.me/linux-redis-install/ 在Ubuntu中安装Redis R利剑NoSQL系列文章,主要介绍通过R语言连接使用nosql数据库.涉及的NoSQL产品,包括Redis, MongoDB, HBase, Hive, Cassandra, Neo4j.希望通过我的介绍让广大的R语言爱好者,有更多的开发选择,做出更多地激动人心的应用. 关于作者: 张丹(Conan), 程序员Java,R,PHP,Javascript weibo:@Con

ubuntu中安装visual studio code-(转载)

在Ubuntu中安装Visual Studio Code 编译自:http://itsfoss.com/install-visual-studio-code-ubuntu/ 作者: Abhishek 原创:LCTT https://linux.cn/article-5423-1.html 译者: Vic020 本文地址:https://linux.cn/article-5423-1.html 2015-05-11 08:20    评论: 3 收藏: 2 本文导航 -安装微软Visual Stu

【Linux】在Ubuntu中安装Eclipse与Helloworld

在Ubuntu中安装Eclipse之前,必须先如同<[Linux]在Debian配置JDK1.7,与Linux Java Helloworld>(点击打开链接)现在Ubuntu中装好JDK1.7,整个安装过程甚至比Debian的还要简单,安装的过程中,活用好把文件拖进终端,这样就不用输入这么长的路径.Ubuntu与Debian唯一的区别,就是执行命令你通通在前面补个sudo就对了,表示以root用户执行这个命令. 一.Eclipse的下载与安装 1.首先,在Eclipse的官网中下载最新版的L

Ubuntu中安装 mercurial – TortoiseHG

sudo add-apt-repository ppa:tortoisehg-ppa/releases sudo add-apt-repository ppa:mercurial-ppa/releases sudo apt-get update sudo apt-get install mercurial python-nautilus tortoisehgUbuntu中安装 mercurial – TortoiseHG,布布扣,bubuko.com

在 ubuntu 中安装 python3.5 tornado pymysql

一.在 ubuntu 中安装 python3.5 1.首先,在系统中是自带python2.7的.不要卸载,因为一些系统的东西是需要这个的.python2.7和python3.5是可以共存的. 命令如下(已经在阿里云的ubuntu中测试): apt-get install Python-software-properties apt-get install software-properties-common sudo add-apt-repository ppa:fkrull/deadsnake