易截截图软件、单文件、免安装、纯绿色、仅160KB

linux下定时执行计划任务


linux下定时执行计划任务
查看/etc/crontab文件
SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root
HOME=/
# run-parts
01 * * * * root run-parts /etc/cron.hourly
02 4 * * * root run-parts /etc/cron.daily
22 4 * * 0 root run-parts /etc/cron.weekly
42 4 1 * * root run-parts /etc/cron.monthly
前四行是有关设置cron任务运行的环境变量. SHELL变量的值指定系统使用的SHELL环境(该 样例为bash shell),PATH变量定义了执行命令的路径。Cron的输出以电子邮件的形式发给MSILTO变 量定义的用户名. 如果MAILTO变量定义为空字符串(MAILTO=""), 电子邮件不会被发送. 执行命令或脚本时HOME变量可用来设置家目录。
文件/etc/crontab中每行任务的描述格式如下:
minute hour day month dayofweek command
minute - 从0 到 59的 整数
hour - 从0到23的 整数
day - 从1到31的 整数 (必须是指定月份的有效日期)
month - 从1到12的 整数 (或如Jan或Feb简写的月份)
dayofweek - 从0到7的整数,0或7用来描述周日 (或 用Sun或Mon简 写来表示)
command - 需要执行的命令(可用as ls /proc >> /tmp/proc或 执行自定义脚本的命令)
root表示以root用户身份来运行
run-parts表示后面跟着的是一个文件夹,要执行的是该文件夹下的所有脚本
对于以上各语句,星 号(*)表 示所有可用的值. 例 如,*在 指代month时表示每月执行(需要符合其他限制条件)该命令。
整数间的连字号(-)表 示整数列,例 如1-4意 思是整数1,2,3,4.
指定数值由逗号分开。如:3,4,6,8表 示这四个指定整数.
符号“/”指定步进设置.“/<interger>”表示步进值。如0-59/2定义每两分钟执行一次。步进值也可用星号表示。如*/3用来运行每三个月份运行指定任务.
以“#”开头的为注释行,不会被执行。
如果一个cron任 务需要定期而不是按小时,天,周,月来执行,则需要添加/etc/cron.d目录. 这个目录下的所有文件和文件/etc/crontab语法相同. 查看样例
# record the memory usage of the system every monday
# at 3:30AM in the file /tmp/meminfo
30 3 * * mon cat /proc/meminfo >> /tmp/meminfo
# run custom scrīpt the first day of every month at 4:10AM
10 4 1 * * /root/scrīpts/backup.sh
除了root用户之外的用户可以执行crontab配置计划任务。所有用户定义的crontab


相关文档:

Linux use notes

-----------------------------
Based on Fedora 8 version:
-----------------------------
1. No common command like ifconfig in os?
Root cause is the standard search path not include /sbin and /usr/sbin. Try to include them in /etc/profile. As belows:
 #Kenny add /sbin and /usr/sbin here.
&n ......

Linux驱动开发学习步骤

1. 学会写简单的makefile
    2. 编一应用程序,可以用makefile跑起来
    3. 学会写驱动的makefile
    4. 写一简单char驱动,makefile编译通过,可以insmod, lsmod, rmmod. 在驱动的init函数里打印hello world, insmod后应该能够通过dmesg看到输出。
  &n ......

在 Linux x86 上安装 Oracle RAC 10g

DBA:Linux
在 Linux x86 上安装 Oracle RAC 10g
作者:John Smiley
了解在 Red Hat Enterprise Linux 或 Novell SUSE Enterprise Linux 上从头安装 Oracle RAC 10g 的基础知识(仅用于评估)
目录
概述
背景
第 1 部分: 安装 Linux
第 2 部分: 为 Oracle 配置 Linux
第 3 部分: 准备共享磁盘
第 4 部分: ......

linux驱动程序实例

本例是冯国进的 《嵌入式Linux 驱动程序设计从入门到精通》的第一个例子
感觉真是好书   强烈推荐
注释是deep_pro加的 转载请注明!我的特点是文不加点!
这个驱动是在内存中分配一个256字节的空间,供用户态应用程序读写。
先是头文件 demo.h
#ifndef _DEMO_H_
#define _DEMO_H_
#include <linux/ioct ......

LINUX C 链表封装


main.c
//初始化队列
void InitQueue(LiQueue *q)
{
  q=(LiQueue*)malloc(sizeof(LiQueue));
    q->front=q->rear=NULL;
}
//判断是否为空
int QueueEmpty(LiQueue *q)
{
 if(q->rear==NULL)
 {
  return 1;
 }
 else
 {
  ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号