On 31 May 2020, at 03:11, Laura Smith <[email protected]>
wrote:
> On Sunday, 31 May 2020 09:35, @lbutlr <[email protected]> wrote:
>> A couple of notes on this quite useful script:
>>
>> My mktemp does not support -p (FreeBSD 12.1) is I had to change the script
>> to:
>
>
> In my scripts I tend to create a tempdir and then tempfiles within that. It
> makes the cleanup routine neater, e.g. at the top of my scripts :
The script linked in my message has most, if not all the features you mention
below. I was simply pointing out for anyone who followed this that FreeBSD's
mktempo does not support the -p flag and the changes I made to the line that
created the temp directory in order to work.
> TEMP_DIR=$(mktemp -qd || { doLog "Failed to make temp dir !"; exit 1; })
> rmTmpFiles() { rm -rf "${TEMP_DIR}"; }
> createTempFile() { local MYTEMP=$(mktemp -qp "${TEMP_DIR}" || doLog "Failed
> to create temp file"; exit 1); echo $MYTEMP; }
>
> Also my backup scripts have locking procedures built-in so as to avoid race
> conditions.
--
"Are you pondering what I'm pondering?"
"Well, I think so, Brain, but I can't memorize a whole opera in
Yiddish."