Running scripts with a timeout #3461
Replies: 2 comments
-
That's a very clever use of the script difference checking. For monthly scripts, this does not require a There is no way to get the equivalent of |
Beta Was this translation helpful? Give feedback.
-
Here's another nice use of Here the script is re-run whenever the version of the underlying software changes. |
Beta Was this translation helpful? Give feedback.
-
Hi!
Actually, I mostly wanted to make this post to express my appreciation. chezmoi is really amazing. I just spent the better part of this weekend migrating my heap of scripts to chezmoi. I was sceptical at first, because my scripts served me surprisingly well for a long time. But chezmoi has so many useful features which are unimaginable to reproduce with homegrown shell scripts. Thank you to everyone who contributed. twpayne especially, of course.
But I do have a little show-and-tell! My scripts run a few different kinds of updates. Most notably,
dnf update
which is notoriously slow. Now, I couldn't just make the update scriptsonchange_
, then they wouldn't run for a long time because the update command itself doesn't change. I'm quite happy with this weekly cache invalidation:With this, I can make the script
onchange_
and it won't run more than once per week. I think the documentation mentions the possiblity to include the hashes of other files for invalidation. Maybe more examples like this time-based invalidation could be added, to inspire users to find creative ways to rerun their scripts. Just a suggestion.Again, thank you for making chezmoi!
Beta Was this translation helpful? Give feedback.
All reactions