8种机械键盘轴体对比
本人程序员,要买一个写代码的键盘,请问红轴和茶轴怎么选?
1.配置
首先查看一下/etc/crontab文件:SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root
HOME=/
# For details see man 4 crontabs
# Example of job definition:
# .---------------- minute (0 - 59)
# | .------------- hour (0 - 23)
# | | .---------- day of month (1 - 31)
# | | | .------- month (1 - 12) OR jan,feb,mar,apr ...
# | | | | .---- day of week (0 - 6) (Sunday=0 or 7) OR sun,mon,tue,wed,thu,fri,sat
# | | | | |
# * * * * * user-name command to be executed
前四行是有关设置cron任务运行的环境变量。
SHELL变量的值指定系统使用的SHELL环境(该样例为bash shell),
PATH变量定义了执行命令的路径。
Cron的输出以电子邮件的形式发给MAILTO变量定义的用户名。如果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表示后面跟着的是一个文件夹,要执行的是该文件夹下的所有脚本
3.编辑设置定时任务crontab -u root -e
2.服务启动
可以用以下的方法启动、关闭这个服务:/sbin/service crond start //启动服务
/sbin/service crond stop //关闭服务
/sbin/service crond restart //重启服务
/sbin/service crond reload //重新载入配置
3.自动启动
在/etc/rc.d/rc.local这个脚本的末尾加上:/sbin/service crond start
二、git 举例
场景说明:每两分更新一次doc-api项目。
1. 编写脚本
vi /root/cron-minute-5/doc-api.sh#!/bin/sh
currentDir=$PWD
echo "Start to publish...n"
cd /home/api-doc/
git pull
cd $currentDir
2.授权chmod +x /root/cron-minute-5/doc-api.sh
3.设置定时任务
crontab -u root -e
输入:*/2 * * * * /root/cron-minute-5/doc-api.sh