ubuntu 定时、开机启动例子
来源:互联网 发布:生意宝采集软件 编辑:程序博客网 时间:2024/06/07 08:03
# /etc/crontab: system-wide crontab# Unlike any other crontab you don't have to run the `crontab'# command to install the new version when you edit this file# and files in /etc/cron.d. These files also have username fields,# that none of the other crontabs do.SHELL=/bin/shPATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin# m h dom mon dow user command17 * * * * root cd / && run-parts --report /etc/cron.hourly25 6 * * * root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily )47 6 * * 7 root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.weekly )52 6 1 * * root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.monthly )*/1 * * * * root date >> /home/time.log */5 * * * * root /usr/share/nginx/sh/du.sh #定时分钟执行du.sh#
"/etc/crontab" 17L, 817C
service cron restartservice cron startservice cron stop
#du.sh
#!/bin/bashIFS=':'#echo "Employee Names:"#echo "---------------"while read name empid deptdo if [ ! $name ]; then echo date >>/usr/share/nginx/sh/du.log echo "IS NULL" >> /usr/share/nginx/sh/du.log else echo date >> /usr/share/nginx/sh/du.log echo "$name is part of $name department">> /usr/share/nginx/sh/du.log mkdir /usr/share/nginx/www/files/ws/video/videolist/$name ffmpeg -i /usr/share/nginx/www/files/ws/video/tmpvideo/$name -y -ab 32 -ar 22050 -qscale 10 -s 640*480 -r 15 /usr/share/nginx/www/files/ws/video/videolist/$name/index.mp4 sed -i '1d' /usr/share/nginx/sh/record.txt rm -rf /usr/share/nginx/www/files/ws/video/tmpvideo/$name break fidone < /usr/share/nginx/sh/record.txtexit 0
在/etc/init.d/rc.local中设置开机启动
0 0
- ubuntu 定时、开机启动例子
- Ubuntu 16.04 开机启动和定时任务
- ubuntu添加开机启动
- ubuntu开机启动goAgent
- ubuntu 开机启动fsck
- Ubuntu 开机自动启动
- ubuntu开机启动svn
- ubuntu开机启动脚本
- ubuntu 开机启动服务
- UBUNTU开机启动相关
- ubuntu 开机自动启动
- ubuntu 设置开机启动
- ubuntu开机启动
- ubuntu开机自动启动
- ubuntu开机启动
- Ubuntu开机启动
- Ubuntu 配置开机启动
- ubuntu开机启动
- 游戏的主要逻辑
- 图结构练习——最短路径
- Gerrit简单使用
- 浅解点击劫持与注入攻击
- 《Spring 2.0技术手册》 读书笔记七-Spring的DAO框架(1)-原理与DataSource注入
- ubuntu 定时、开机启动例子
- 20-IO流-05-IO流(字符流-FileWriter-IO异常处理)
- APP适配IOS8,iPhone6和Plus截图简要说明
- Go 数据类型(续)— array、slice、map
- C源码@数据结构与算法->表(Cursor )
- 如何解决MathType工具栏符号乱码问题?
- c++防止迭代器失效
- 20-IO流-06-IO流(字符流-FileReader-读取方式一)
- iPhone屏幕尺寸、分辨率及适配