Skip to content

Commit

Permalink
2015-12-09
Browse files Browse the repository at this point in the history
  • Loading branch information
YouMeek committed Dec 9, 2015
1 parent 2c6d2b8 commit b712881
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 1 deletion.
40 changes: 40 additions & 0 deletions Crontab.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<h1 id="crontab0">Crontab 介绍</h1>

------

* [Crontab 介绍](#crontab0)
* [Crontab 安装](#crontab1)
* [Crontab 服务器配置文件常用参数](#crontab2)
* [Crontab 资料](#crontab3)

------

<h2 id="crontab1">Crontab 安装</h2>

- 查看是否已安装:
- CentOS:`rpm -qa | grep cron`
- Ubuntu:`dpkg -l | grep cron`

- 安装(一般系统是集成的):
- CentOS 6:`sudo yum install -y vixie-cron crontabs`
- Ubuntu:`sudo apt-get install -y cron`

<h2 id="crontab2">Crontab 服务器配置文件常用参数</h2>

- 配置文件介绍(记得先备份):`sudo vim /etc/crontab`
- 该配置格式解释:
- ![Crontab 服务器配置文件常用参数](images/Crontab-a-1.jpg)
- 常用例子介绍:
- 30 21 * * * service httpd restart #每晚的 21:30 重启 apache
- 45 4 1,10,22 * * service httpd restart #每月的 1、10、22 日的 4:45 重启 apache
- 45 4 1-10 * * service httpd restart #每月的 1 到 10 日的 4:45 重启 apache
- */2 * * * * service httpd restart #每隔两分钟重启 apache
- 1-59/2 * * * * service httpd restart #每隔两分钟重启 apache(这个比较特殊:1-59/2 这个表示过掉0分,从 1 分开始算,每隔两分执行,所以 1 分执行了,3 分执行了,5 分执行了....都是奇数进行执行。默认的 */2 都是偶数执行。)
- 0 23-7/2 * * * service httpd restart #晚上 11 点到早上 7 点之间,每隔 2 个小时重启 apache
- 0-59/30 18-23 * * * service httpd restart #每天 18:00 到 23:00 之间,每隔 30 分钟重启 apache(方法一)
- 0,30 18-23 * * * service httpd restart #每天 18:00 到 23:00 之间,每隔 30 分钟重启 apache(方法二)

<h2 id="crontab3">Crontab 资料</h2>

- <http://www.imooc.com/video/4498>
- <http://www.centoscn.com/image-text/config/2015/0901/6096.html>
5 changes: 4 additions & 1 deletion Samba.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

<h2 id="samba2">Samba 服务器配置文件常用参数</h2>

- 配置文件介绍(记得先备份):`sudo /etc/samba/smb.conf`
- 配置文件介绍(记得先备份):`sudo vim /etc/samba/smb.conf`
- 该配置解释:
-[globle] 区域
- workgroup = WORKGROUP #WORKGROUP表示Windows默认的工作组名称,一般共享给windows是设置为WORKGROUP
Expand Down Expand Up @@ -52,3 +52,6 @@
<h2 id="samba3">Samba 资料</h2>
- <http://www.lvtao.net/linux/555.html>
- <https://www.centos.bz/2011/07/centos5-install-samba-windows-linux-fileshare/>
- <https://wsgzao.github.io/post/samba/>
- <http://linux.vbird.org/linux_server/0370samba.php>
Binary file added images/Crontab-a-1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit b712881

Please sign in to comment.