tachtler / dovecot-backup

Dovecot backup shell script for saving emails for every mailbox to its own tar.gz file.
GNU General Public License v3.0
56 stars 20 forks source link

Does not run rm if no files need to be removed #5

Closed Seep1959 closed 6 years ago

Seep1959 commented 6 years ago

Fixes error where xargs attempts to run rm with no operands when there exists less than $BACKUPFILES_DELETE .

tachtler commented 6 years ago

Hi Seep1959,

thank you for your support!

The xargs option -r means:

If the standard input is completely empty, do not run the command. By default, the command is run once even if there is no input.?

Is that right?

Why would you change the owner and permission after backup? Normally, the backup file owner are like this, after a few backups:

-rw-r--r-- 1 vmail vmail 91410646 Aug  4 03:17 klaus@tachtler.net-dovecot_backup_20180804_031301.tar.gz
-rw-r--r-- 1 vmail vmail 91742688 Aug  5 03:11 klaus@tachtler.net-dovecot_backup_20180805_030701.tar.gz
-rw-r--r-- 1 root  root  92972453 Aug  6 03:55 klaus@tachtler.net-dovecot_backup_20180806_035001.tar.gz

Is the file permission 644 not secure enough for you, so that you need 600?

Thank you! Klaus.

tachtler commented 6 years ago

Hi Seep1959,

I made a new version 1.06 - can you try that version?

I realized your features, but a little bit other than in your pull request. So I closed this pull request, BUT your name was in the history - thank you for your support!

Thank you! Klaus.

Seep1959 commented 6 years ago

Hi Klaus, I have scripts that run as my mail user that need to be able to read/write to the backups, having one of them owned as root prevents that. As sensitive information can be contained in the backups, I like to not have it world readable, the backup directory being 700 should prevent world from being able to read them but I like to be certain. I'll give 1.06 a test later.

Thanks!