Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added skipping mail backup in backup process #551

Merged
merged 2 commits into from
Apr 26, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,19 @@ You can start the process as follows::

Then follow the step on the console.

There is also a non-interactive mode:
There is also a non-interactive mode::

$ sudo ./run.py --silent-backup <your domain>

You can also add a path, else it will be saved in ./modoboa_backup/Backup_M_Y_d_H_M::

$ sudo ./run.py --silent-backup --backup-path "/My_Backup_Path" <your domain>

if you want to disable mail backup::

$ sudo ./run.py --backup --no-mail <your domain>

This can be useful for larger instance

1. Silent mode

Expand Down
5 changes: 5 additions & 0 deletions run.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,8 @@ def backup_system(config, args):
utils.copy_file(args.configfile, backup_path)
# Backup applications
for app in PRIMARY_APPS:
if app == "dovecot" and args.no_mail:
utils.printcolor("Skipping mail backup", utils.BLUE)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A "continue" statement might be useful here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hehe indeed

scripts.backup(app, config, backup_path)


Expand Down Expand Up @@ -171,6 +173,9 @@ def main(input_args):
help="For script usage, do not require user interaction "
"backup will be saved at ./modoboa_backup/Backup_M_Y_d_H_M "
"if --backup-path is not provided")
parser.add_argument(
"--no-mail", action="store_true", default=False,
help="Disable mail backup (save space)")
parser.add_argument(
"--restore", type=str, metavar="path",
help="Restore a previously backup up modoboa instance on a NEW machine. "
Expand Down