Re:Minimal safe Bash script template
by michaelcampbell on Thursday December 17, 2020 @09:55AM
(#25456087)
I like the idea of a separate lock/semaphor per input args. Haven't needed that yet but I can see where I might.
Re:Minimal safe Bash script template
by AdamGibbins on Tuesday December 15, 2020 @05:54PM
(#25436447)
flock isn't all platforms unfortunately, doesn't exist on MacOS.
This means there can only be one process writing to a given log file at a time. For me, that is the right granularity of locking - i have several cron jobs running this script, but with different arguments, and writing to different log files.