You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the exec resource, we sometimes resort to creating a trigger to know to run some commands if a file has been modified. A trigger file is created to compare the modified time of the file and the trigger file that has been created, and then the command is run based on that check.
The trigger_watch option would take in a file that it should watch. Mgmt would create the trigger file, manage it, and mgmt would do the checks on that file and run the command if a change has been made.
The text was updated successfully, but these errors were encountered:
As we write more modules, we'll see if we see this pattern over and over again, and if so, it might be worth implementing something like this!
Some technical underpinnings: We may wish to implement this as a combination of watchfiles (to watch the input file) and donecmd (to touch the mtime file which we could hide in the res $vardir) and ifcmd which we have an mtime check done automatically with golang stat.
If we could come up with an elegant API, we may similarly want to implement an mtimeif so that we can compare mtimes without using bash.
On bikeshedding: I don't love the name trigger_watch, if we get there, we should consider what to do instead. Maybe trigger_file ? Or mtime_file or ???
In the exec resource, we sometimes resort to creating a trigger to know to run some commands if a file has been modified. A trigger file is created to compare the modified time of the file and the trigger file that has been created, and then the command is run based on that check.
For example, this exec resource is complex
Can be written like this instead
The
trigger_watch
option would take in a file that it should watch. Mgmt would create the trigger file, manage it, and mgmt would do the checks on that file and run the command if a change has been made.The text was updated successfully, but these errors were encountered: