易截截图软件、单文件、免安装、纯绿色、仅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中的内存分配和释放之__alloc_boot函数分析

 对于这个函数,其实是很多宏定义调用的函数,其中alloc_bootmem_low_pages(x)是其中一个调用它的宏,大家可以认为这些宏只是把这个__alloc_bootmem实质性的函数进行了封装。#define alloc_bootmem_low_pages(x)相当于__alloc_bootmem((x), PAGE_SIZE, 0),就是从0地址开始的低端内存分配按页大小对齐的内存。好了,为 ......

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下nfs tftp 配置使用

linux下几种服务器的配置使用之一:nfs tftp 
安装nfs需要在服务器端关闭iptables防火墙,关闭方法如下
查看防火墙状态:
/etc/init.d/iptables status
暂时关闭防火墙:
/etc/init.d/iptables stop
禁止防火墙在系统启动时启动
/sbin/chkconfig --level 2345 iptables off
重启iptables:
/etc/init.d/iptabl ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号