Displaying 3 results from an estimated 3 matches for "createtempfile".
2020 May 31
4
Simple backup of maildir folder
On 29 May 2020, at 23:49, Admin Beckspaced <admin at beckspaced.com> wrote:
> I also have maildir as mailbox format and use the following script to do daily backups
>
> https://github.com/tachtler/dovecot-backup
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:
DIR_TEMP=$($MKTEMP_COMMAND -d $TMP_FOLDER
2020 May 31
0
Simple backup of maildir folder
...e 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 :
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.
2020 May 31
1
Simple backup of maildir folder
...gt; 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 :
>
> 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; }
>
I don?t think I need to clean up, and my ?temp_dir? will end up being permanent, as to make doveadm backup snappier I will simply maintain the directory there and u...