在/etc/crontab
每列表示意义
a. 第一个\*表示的是分钟1~59分钟,默认\*表示的是每分钟都执行,x-y表示的是x~y这段每分钟都执行,\*/n表示每n分钟执行一次,x,y,z表示的是x,y,z分钟都执行。
b. 第二个\*表示的是小时1~23小时,默认\*表示的是每小时都执行,x-y表示的是x~y这段每小时都执行,\*/n表示每n小时执行一次,x,y,z表示的是x,y,z小时都执行。
c. 第三个\*表示的是天1~31,默认\*表示的是每天都执行,x-y表示的是x~y这段每天都执行,\*/n表示每n天执行一次,x,y,z表示的是x,y,z天都执行。
d. 第四个\*表示的是月1~12,默认\*表示的是每个月都执行,x-y表示的是x~y这个段每月都执行,\*/n表示每n分钟执行一次,x,y,z表示的是x,y,z天都执行。
e. 第五个\*表示的是周0~6(0表示周天),默认周一~周天都执行,x-y表示周x~周y每天都执行。
5\. crontab文件的一些例子
a. 30 21 \* \* \* /usr/local/etc/rc.d/lighttpd restart //表示每天21:30重启apache
b. 45 4 1,10,22 \* \* /usr/local/etc/rc.d/lighttpd restart //表示每月1,10,22号4:45重启apache
c. 0,30 18-23 \* \* \* /usr/local/etc/rc.d/lighttpd restart //表示每天18 : 00至23 : 00之间每隔30分钟重启apache
d. \* \*/1 \* \* \* /usr/local/etc/rc.d/lighttpd restart //表示每一小时重启apache
e. \*/5 \* \* \* \* /usr/local/etc/rc.d/lighttpd restart //表示每5分钟重启apache
#结算
\# \*代表:分 时 天 周 月
# /usr/local/php/bin/php 是php运行目录
\# /data/www/[vote.shengwuoem.com/www/cli.php](http://vote.shengwuoem.com/www/cli.php)要执行的文件
# index/event\_over/auth\_key/chunsing (index:控制器;event\_over:方法;auth\_key:值的名称;chunsing:值)
\* \* \* \* \* root /usr/local/php/bin/php /data/www/[vote.shengwuoem.com/www/cli.php](http://vote.shengwuoem.com/www/cli.php)index/event\_over/auth\_key/chunsing >>/data/www/[vote.shengwuoem.com/www/logs/event\_over.txt](http://vote.shengwuoem.com/www/logs/event_over.txt)
#机器人参加活动
\*/5 \* \* \* \* root /usr/local/php/bin/php /data/www/[vote.shengwuoem.com/www/cli.php](http://vote.shengwuoem.com/www/cli.php)index/robot\_join/auth\_key/chunsing >>/data/www/[vote.shengwuoem.com/www/logs/robot\_join.txt](http://vote.shengwuoem.com/www/logs/robot_join.txt)
#机器人投票
\*/5 \* \* \* \* root /usr/local/php/bin/php /data/www/[vote.shengwuoem.com/www/cli.php](http://vote.shengwuoem.com/www/cli.php)index/robot\_vote/auth\_key/chunsing >>/data/www/[vote.shengwuoem.com/www/logs/robot\_vote.txt](http://vote.shengwuoem.com/www/logs/robot_vote.txt)
#修改活动状态
\* \* \* \* \* root /usr/local/php/bin/php /data/www/[vote.shengwuoem.com/www/cli.php](http://vote.shengwuoem.com/www/cli.php)index/event\_update\_status/auth\_key/chunsing >>/data/www/[vote.shengwuoem.com/www/logs/event\_update\_status.txt](http://vote.shengwuoem.com/www/logs/event_update_status.txt)
重启服务器:
systemctl restart nginx
- 简介
- PHP的优势
- PHP运行原理和机制
- PHP7有哪些新特性
- 第一章 PHP
- 基础
- 1、流程控制
- if...else
- switch
- for
- while
- foreach
- 跳出循环
- 2、数组函数
- 数组排序
- sort() - 以正序数组排序
- rsort() - 以降序对数组排序
- asort() - 根据值,以升序对关联数组进行排序
- ksort() - 根据键,以升序对关联数组进行排序
- arsort() - 根据值,以降序对关联数组进行排序
- krsort() - 根据键,以降序对关联数组进行排序
- 数组函数
- array_column() - 返回输入数组中某个单一列的值
- array_merge() - 把一个或多个数组合并为一个数组
- array_search() - 搜索数组中给定的值并返回键名
- array_shift() - 删除数组中首个元素,并返回被删除元素的值
- array_pop() - 删除数组的最后一个元素(出栈)
- array_product() - 计算数组中所有值的乘积
- array_push() - 将一个或多个元素插入数组的末尾(入栈)
- array_rand() - 返回数组中一个或多个随机的键
- array_sum() - 返回数组中值的和
- array_unique() - 删除数组中的重复值
- array_unshift() - 在数组开头插入一个或多个元素
- array_values() - 返回数组中所有的值
- in_array() - 检查数组中是否存在指定的值
- list() - 把数组中的值赋给一些变量
- 3、字符串函数
- strlen() - 返回字符串长度
- substr() - 截取字符串
- str_replace() - 把字符串的一部分替换为另一个字符串
- str_ireplace() - 替换字符串中的一些字符(对大小写不敏感)
- strstr() - 查找字符串在另一字符串中的第一次出现(对大小写敏感)
- stristr() - 查找字符串在另一字符串中第一次出现的位置(大小写不敏感)
- strripos() - 查找字符串在另一字符串中最后一次出现的位置(对大小写不敏感)
- strrpos() - 查找字符串在另一字符串中最后一次出现的位置(对大小写敏感)
- trim() - 移除字符串两侧的空白字符和其他字符
- rtrim() - 移除字符串右侧的空白字符或其他字符
- ltrim() - 移除字符串左侧的空白字符或其他字符
- strrev() - 反转字符串
- explode() - 把字符串打散为数组
- implode() - 数组转换为字符串
- strip_tags() - 剥去字符串中的 HTML 和 PHP 标签
- strtolower() - 把字符串转换为小写字母
- strtoupper() - 把字符串转换为大写字母
- htmlentities() - 把字符转换为 HTML 实体
- html_entity_decode() - 把 HTML 实体转换为字符
- md5() - 计算字符串的 MD5 散列
- md5_file() - 计算文件的 MD5 散列
- sha1() - 计算字符串的 SHA-1 散列
- sha1_file() - 计算文件的 SHA-1 散列
- 4、日期时间
- date() - 函数把时间戳格式化为更易读的日期和时间
- mktime() - 返回日期的 Unix 时间戳
- strtotime - 转化为时间戳
- 第二章 MYSQL
- 简介
- connect - 连接数据库
- create - 创建数据库和表
- insert - 添加数据
- select - 查询数据
- update - 修改数据
- delect - 删除数据
- where - 条件
- order by - 关键词
- 第三章 编辑器
- phpstorm
- 第四章 框架
- thinkphp5.0
- tp安装
- 开发规范
- 目录结构
- 数据库
- 查询数据
- 添加数据
- 更新数据
- 删除数据
- 查询方法
- 查询语法
- 链式操作
- where
- table
- alias
- field
- order
- limit
- page
- group
- having
- join
- union
- distinct
- lock
- cache
- comment
- fetchSql
- force
- bind
- partition
- strict
- failException
- sequence
- 聚合查询
- 时间查询
- 高级查询
- 视图查询
- 子查询
- 原生查询
- 事务操作
- 监听SQL
- 存储过程
- 分布式数据库
- 第五章 服务器
- 阿里云服务器
- linux命令
- nginx
- Nginx搭建负载均衡环境简单实现
- memcached
- redis
- 杂项
- http 状态码
- 消息
- 100 Continue
- 101 Switching Protocols
- 102 Processing
- 成功
- 200 OK
- 201 Created
- 202 Accepted
- 203 Non-Authoritative Information
- 204 No Content
- 205 Reset Content
- 206 Partial Content
- 207 Multi-Status
- 重定向
- 300 Multiple Choices
- 301 Moved Permanently
- 302 Move temporarily
- 303 See Other
- 304 Not Modified
- 305 Use Proxy
- 306 Switch Proxy
- 307 Temporary Redirect
- 请求错误
- 400 Bad Request
- 401 Unauthorized
- 402 Payment Required
- 403 Forbidden
- 404 Not Found
- 405 Method Not Allowed
- 406 Not Acceptable
- 407 Proxy Authentication Required
- 408 Request Timeout
- 409 Conflict
- 410 Gone
- 411 Length Required
- 412 Precondition Failed
- 413 Request Entity Too Large
- 414 Request-URI Too Long
- 415 Unsupported Media Type
- 416 Requested Range Not Satisfiable
- 417 Expectation Failed
- 421 too many connections
- 422 Unprocessable Entity
- 423 Locked
- 424 Failed Dependency
- 425 Unordered Collection
- 426 Upgrade Required
- 449 Retry With
- 451Unavailable For Legal Reasons
- 服务器错误
- 500 Internal Server Error
- 501 Not Implemented
- 502 Bad Gateway
- 503 Service Unavailable
- 504 Gateway Timeout
- 505 HTTP Version Not Supported
- 506 Variant Also Negotiates
- 507 Insufficient Storage
- 509 Bandwidth Limit Exceeded
- 510 Not Extended
- 600 Unparseable Response Headers
- linux下自动执行任务
- restful api
- 富文本编辑器
- ueditor
- wangEditor
- js定时器
- 局域网访问本地项目
- 微信公众号网页授权登录
- 服务器配置https
- 配置虚拟目录
- ab压力测试
- 使用ab进行页面的压力测试
- apache性能测试工具ab使用详解
- 前后端分离之用户验证
- PHP面试题
- 题库一
- 题库二
- 题库三
- 题库四
- 题库五
- 题库六
- 算法题
- 星星算法
