当前位置:网站首页>直接修改/etc/crontab 文件内容,定时任务不生效
直接修改/etc/crontab 文件内容,定时任务不生效
2022-06-27 08:08:00 【雅冰石】
直接写/etc/crontab 文件内容不生效。
service crond reload/restart 也不生效。
直接写crontab文件时,需要指定执行用户,并且上面的环境变量不能删除。
如:
# cat /etc/crontab
SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root
HOME=/
*/1 * * * * root date > /root/test.txt
如果定时任务中不指定运行用户,如:
*/1 * * * * date > /root/test.txt
则不会执行此条命令。
转载于:https://blog.51cto.com/zhangxingnan/1609879
边栏推荐
猜你喜欢

SPARQL basic introductory exercise

Rust async: SMOL source code analysis -executor

lvgl 说明3关于lvgl guider的使用

大厂工作十年,年薪40万突然被裁员,公司想抛弃你,一分情面都不会留

JS use the switch statement to output the corresponding English day of the week according to 1-7

关联GIS:条条道路通UE5城

Binary tree structure and heap structure foundation
![[batch dos-cmd command - summary and summary] - environment variables, path variables, search file location related instructions - set, path, where, what if there are spaces in the path parameters of](/img/ca/0b96294336810187e833429fcea5bf.png)
[batch dos-cmd command - summary and summary] - environment variables, path variables, search file location related instructions - set, path, where, what if there are spaces in the path parameters of

Lvgl GUI guide porting code to stm32

MySQL lock details
随机推荐
若xn>0,且x(n+1)/xn>1-1/n(n=1,2,...),证明级数∑xn发散
游戏资产复用:更快找到所需游戏资产的新方法
【批处理DOS-CMD命令-汇总和小结】-批处理命令中的参数%0、%1、%2、%[0-9]、%0-9和批处理命令参数位置切换命令shift,dos命令中操作符%用法
JS to judge the odd and even function and find the function of circular area
lvgl使用demo及说明2
【论文阅读】Intrinsically semi-supervised methods
Redis的持久化机制
MySQL索引详解
JVM层次上的对象的创建过程和内存布局
March into machine learning -- Preface
[notes on c++ primer] Chapter 3 string, vector and array
Mysql-8 download, installation and configuration tutorial under Windows
MySQL environment variable configuration tutorial
js成绩奖惩例题
The IPO of Yefeng pharmaceutical was terminated: Yu Feng, the actual controller who had planned to raise 540million yuan, made P2P investment
Closure problem
【11. 二维差分】
分析日志.log
游戏六边形地图的实现
JS to determine whether the result is qualified, the range is 0-100, otherwise re-enter