Crontab ---- Quick referance

weixin_38052215 2005-01-31 02:25:36

cron is a unix utility that allows tasks to be automatically run in the background at regular intervals by the cron daemon often termed as cron jobs. Crontab (CRON TABle) is a file which contains the schedule of cron entries to be run and at specified times. 1.Crontab Restrictions ____________ You can execute crontab if your name appears in the file /usr/lib/cron/cron.allow. If that file does not exist, you can use crontab if your name does not appear in the file /usr/lib/cron/cron.deny. If only cron.deny exists and is empty, all users can use crontab. If neither file exists, only the root user can use crontab. The allow/deny files consist of one user name per line. 2.Crontab Commands __________ export EDITOR=vi ;to specify a editor to open crontab file. crontab -e Edit your crontab file, or create one if it doesn't already exist. crontab -l Display your crontab file. crontab -r Remove your crontab file. crontab -v Display the last time you edited your crontab file. (This option is only available on a few systems.) 3.Crontab file - syntax ___________ syntax :- A crontab file has five fields for specifying day , date and time followed by the command to be run at that interval. * * * * * command to be executed - - - - - | | | | | | | | | +----- day of week (1 - 7) (monday = 1) | | | +------- month (1 - 12) | | +--------- day of month (1 - 31) | +----------- hour (0 - 23) +------------- min (0 - 59) * Indicates all possible values as in braces for that column. 4.Crontab Example _______ A line in crontab file like below removes the tmp files from /home/someuser/tmp each day at 6:30 PM. 30 18 * * * rm /home/someuser/tmp/* Changing the parameter values as below will cause this command to run at different time schedule below : 30 0 1 1,6,12 * -- 00:30 Hrs on 1st of Jan, June & Dec. 0 20 * 10 1-5 --8.00 PM every weekday (Mon-Fri) only in Oct. 0 0 1,10,15 * * -- midnight on 1st ,10th & 15th of month 5,10 0 10 * 1 -- At 12.05,12.10 every Monday & on 10th of every month 5.Crontab Environment ___________ cron invokes the command from the user's HOME directory with the shell, (/usr/bin/sh). cron supplies a default environment for every shell, defining: HOME=user's-home-directory LOGNAME=user's-login-id PATH=/usr/bin:/usr/sbin:. SHELL=/usr/bin/sh Users who desire to have their .profile executed must explicitly do so in the crontab entry or in a script called by the entry. 6.Disable Email ____________ By default cron jobs sends a email to the user account executing the cronjob. If this is not needed put the following command At the end of the cron job line . >/dev/null 2>&1 7.Generate log file for crontab activity ________________ To collect the cron execution execution log in a file : 30 18 * * * rm /home/someuser/tmp/* > /home/someuser/cronlogs/clean_tmp_dir.log 本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/524/showart_11094.html
...全文
34 回复 打赏 收藏 转发到动态 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复
内容概要:本文档系统整合了基于MATLAB/Simulink的风力涡轮机雷达信号仿真、电力系统优化、新能源调控及多领域智能算法应用资源,涵盖风电功率平抑、混合储能协同调频、综合能源系统调度、无人机三维路径规划、电动汽车参与调度、电氢氨耦合系统优化等前沿科研方向。资源包提供大量可复现的Matlab代码、Simulink仿真模型、数据集及配套论文,涉及GWO、PSO、WOA、HHO等多种智能优化算法,以及LSTM、CNN、GRU等深度学习模型在负荷预测、故障诊断、信号处理中的应用,尤其聚焦于风电与雷达信号交互、储能功率分配、虚拟电厂运行、微电网多时间尺度优化等关键技术的仿真实现。; 适合人群:具备一定MATLAB编程基础,从事电力系统、新能源、智能优化、信号处理、雷达仿真、综合能源管理等相关领域的科研人员及研究生;工作1-3年相关方向的工程师。; 使用场景及目标:①开展风力发电系统与雷达信号交互仿真研究;②复现高水平期刊论文中的优化调度、故障诊断、功率预测模型;③进行无人机路径规划、储能系统设计、综合能源系统优化等课题研究与论文撰写;④借助成熟的代码框架快速搭建仿真模型,提升科研效率与工程实践能力。; 阅读建议:建议按主题分类浏览资源列表,优先选择标注“复现”“顶刊”“EI”等高价值项目,结合提供的网盘链接下载完整代码与数据,配合Simulink仿真模型与说明文档进行调试与二次开发,注重算法实现与实际工程问题的深度融合。
日常处理文本内容时,你是否也常常被这些琐碎又烦人的操作消耗大量时间:从网页复制来的文章满是空行和多余空格,要一段段手动清理;从不同渠道收集的文档繁简混杂,格式五花八门,想统一规范却只能逐篇调整;面对数千行的数据,想按行排序、去重、添加行号,却找不到一个趁手的小工具;更别提Base64编解码、URL转义这些开发中高频使用的操作,每次都得打开在线网站反复折腾——这些看似零散的文本处理需求,单独去搜工具费时费力,用Word又杀鸡用牛刀,始终缺少一款能把这些功能聚合在一起、打开即用的桌面工具。而 大飞哥软件自习室——文本批量整理工具 v2.0正是为整合这些高频文本处理需求而生的专业效率工具,它集文件管理、文本清洗、格式转换、查找替换、批量插入、排序打乱、编码解码、实时统计等近三十项实用功能于一身,采用多标签页设计支持同时编辑多个文档,所有操作均支持撤销与重做,让你在写代码、整理素材、编辑文案时再也不用东拼西凑找工具,一个软件搞定全部文本处理需求。 软件的核心功能模块围绕文本处理的完整工作流展开,覆盖了从“粗加工”到“精处理”的各个环节。文本清洗模块提供了行首尾去空格、清除所有空格、删除空行、合并多余空格、去除重复行、清除HTML标签等六项功能,一键将脏乱差的原始文本快速规整为干净可用的素材。文本转换模块则涵盖了繁简互转、标点中英文互转、全半角互转、全部大写/小写/首字母大写等选项,尤其适合需要批量处理多语言或不同格式规范的文本内容。查找替换模块不仅支持普通文本替换,更提供了正则表达式和区分大小写选项,查找、替换、全部替换、选区替换四种模式灵活应对不同场景。批量插入文本模块更是独树一帜——用户可预设两组插入内容,选择插入到当前段首/段尾或所有段首/段尾,四个单选按钮搭配两个输入框,实现八种插入组合,为批量处理结构化文本提供了极大的便利。

477

社区成员

发帖
与我相关
我的任务
社区描述
其他技术讨论专区
其他 技术论坛(原bbs)
社区管理员
  • 其他技术讨论专区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧