gitlab-backup: pull|restore: Cleanup $tmpd in defer-style
Similarly to previous patch, let's cleanup gitlab-backup temporary folder always unconditionally in the presence of errors. Keeping $tmpd on error was not preventing further gitlab-backup run to proceed, but it can quickly eat up disk space if there are many such runs. If debugging is needed one can comment the cleanup, but by default let's be production friendly out of the box. Based on patch by @alain.takoudjou: kirr/git-backup!4 Original description from Alain: ---- 8< ---- When script exit, remove tmp backup folder which are not longuer needed. Keep this folder when backup is failing will contribute to fill the disk of server. backup.locked is also removed, because we want to automatically retry gitlab-backup if previous backup failed, without human action. If the file is not removed automatically, backup is blocked until someone remove it.
Showing
Please register or sign in to comment