栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 面试经验 > 面试问答

如何让CRON调用正确的PATH

面试问答 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

如何让CRON调用正确的PATH

我用过

/etc/crontab
。我使用
vi
并在该文件中输入了所需的PATH,然后以root身份运行它。普通的crontab会覆盖您设置的PATH。关于如何执行此操作的很好的教程。

系统范围的cron文件如下所示:

This has the username field, as used by /etc/crontab.# /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.# This file also has a username field, 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   command42 6 * * *   root    run-parts --report /etc/cron.daily47 6 * * 7   root    run-parts --report /etc/cron.weekly52 6 1 * *   root    run-parts --report /etc/cron.monthly01 01 * * 1-5 root python /path/to/file.py


转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/412185.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号