gpt4 book ai didi

linux - saltstack : is there a way to stop updating cron files every time state. highstate 运行

转载 作者:塔克拉玛干 更新时间:2023-11-02 23:22:56 25 4
gpt4 key购买 nike

目前我有以下 cron.file 公式

date > system_cron:
cron.file:
- name: salt://crons/cron_jobs
- source_hash: "md5sum=895dcbbddd27bfa77056ef8c8340549a"
- user: security

但是每次运行高状态事件时都会更新 crontab,尽管 cron_jobs 文件没有改变,因此状态是相同的。有没有办法在每次使用 cron.file 时运行 highstate 时停止创建临时 crontab 文件

最佳答案

我发现当文件末尾有空行时,或者如果你有 dos 行结尾而不是 unix 行结尾时,就会发生这种情况。更改后,文件将仅在更改后更新。

请注意:由于您已将文件放在“salt://”中,因此不需要 source_hash。这仅适用于远程(即 http)文件。

关于linux - saltstack : is there a way to stop updating cron files every time state. highstate 运行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31076059/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com