mailcow-dockerized icon indicating copy to clipboard operation
mailcow-dockerized copied to clipboard

Feature/enhance backup script

Open OpenSpaghettiSauce opened this issue 2 years ago โ€ข 16 comments

Sorry that I make another appearance regarding this script. I use it a lot and the latest THREADS was a great improvement.

This time, I added two things:

  • NODATE This skips the creation of the timestamp folder. Why? If you back up via s3fs, or backblaze/s3 client, you may opt for overwriting your backup files, and store them with the same name. This way, you can use bucket policy to practically never run out of disk space (well, never run out of money) and still have several snapshots available.

Usage: Specifying any value, such as NODATE=1 will work.

  • 'help' Adds a new option the user can call to see what the script can actually do. It can be called with ".sh help", or if the user simply calls the script without any argument, the script now tells them about this.

Feel free to change NODATE's name, or the text of help, of course. This worked for me, but I'm just a user of this great project. Thank you guys for your continued work on Mailcow!

OpenSpaghettiSauce avatar Nov 02 '22 16:11 OpenSpaghettiSauce

Nice nice. But one question i have left somewhere in my brain :D :

  • What happen if you restore this backup with the NO_DATE Variable? How does the Script behave then?

DerLinkman avatar Nov 02 '22 21:11 DerLinkman

Okay that is an absolutely valid question! I'll test it out ASAP and report back/fix my branch.

OpenSpaghettiSauce avatar Nov 02 '22 21:11 OpenSpaghettiSauce

Totally valid point.

I suppose the var support could be added here too but... But, if I think about it more... why even check for a folder?

I mean, shouldn't the user just point the script to a folder, such as let's say /backup/mailcow-2022-11-03-01-49-04/?

I am saying this with utmost respect, this is your work, your project. Just asking, like maybe it'd easier to drop the whole folder selection thing?

For sanity check, like "to make sure this is a proper backup folder", I would probably change the script again (yeah, I know, I should just close my account, sorry). Let's say put a "mailcow_backup.txt" within the folder, And the content would be like: for var in *; do md5sum $var; done. And if the files in the folder check out, then it is a valid backup?

md5val backup_crypt.tar.gz
md5val backup_mariadb.tar.gz
md5val backup_postfix.tar.gz
md5val backup_redis.tar.gz
md5val backup_rspamd.tar.gz
md5val backup_vmail.tar.gz
md5val mailcow.conf

But then you also have the specific backup modes, like when you only backup some part, and not 'all'.

I am just thinking out loud, so to say. Let me know if you have any ideas...

OpenSpaghettiSauce avatar Nov 03 '22 00:11 OpenSpaghettiSauce

I suppose the var support could be added here too but...

Yeah i think this is the way we want to go.

Not all users want to use a bucket for backup savings and therefore the policys.

So i guess to make everyone happy weยดll simply add the variable.

DerLinkman avatar Nov 23 '22 09:11 DerLinkman

I'll add it then in a moment. Thank you. Well I'm saying a moment but I swear I'll get 10 calls in the next 5 minutes. They sniff this out.

OpenSpaghettiSauce avatar Nov 23 '22 09:11 OpenSpaghettiSauce

I'll add it then in a moment. Thank you. Well I'm saying a moment but I swear I'll get 10 calls in the next 5 minutes. They sniff this out.

Good man. I actually was about trying to do this as well. But please feel free.

DerLinkman avatar Nov 23 '22 10:11 DerLinkman

No u.

Seriously, it's your project, you know how you like this to be implemented. And thank you for not forgetting about this, appreciate it!

OpenSpaghettiSauce avatar Nov 23 '22 10:11 OpenSpaghettiSauce

No u.

Seriously, it's your project, you know how you like this to be implemented. And thank you for not forgetting about this, appreciate it!

Yes but please do that though I've deleted the things (which were not many to be honest) because I'm not sure how to implement it.

DerLinkman avatar Nov 23 '22 12:11 DerLinkman

Besides that it's "mailcow" and it needs a doc PR.

andryyy avatar Nov 30 '22 20:11 andryyy

Sorry @andryyy , could you elaborate, please? Thank you!

OpenSpaghettiSauce avatar Nov 30 '22 23:11 OpenSpaghettiSauce

Okay so I tested it, it worked for me (NODATE=1), please verify once time allows. Thank you.

OpenSpaghettiSauce avatar Dec 01 '22 13:12 OpenSpaghettiSauce

Sorry @andryyy , could you elaborate, please? Thank you!

What @andryyy was saying is that firstly the "Mailcow" Names inside your PR have to be called "mailcow" with a small M and secondly that this new Parameter needs a entry in the mailcow docs repo: https://github.com/mailcow/mailcow-dockerized-docs

DerLinkman avatar Dec 01 '22 19:12 DerLinkman

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

milkmaker avatar Mar 18 '23 15:03 milkmaker

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

milkmaker avatar May 25 '23 06:05 milkmaker

Why is this PR blocked? Is the only thing missing the documentation?

DaGuich avatar Jun 10 '23 11:06 DaGuich

Will this PR ever be merged? I'm really interested in the NODATE option so I can use the mailcow backup folder in my borg backup without having timestamped paths in my already timestamped borg backups.

Programie avatar Mar 25 '24 16:03 Programie