Google Drive Backups with Duplicity

I am new to Mail-In-A-Box. And I have a few questions:

Is it possible to setup Google Drive with Duplicity for the storage of the backups?

Is it possible to have the backups deleted from local once they are at the remote storage?
Otherwise one would have to calculate double the mail storage for ones box if I am not mistaken.

@michacassola I imagine all of the things you asked are completely possible. However, you may have to create scripts for such things. I havenā€™t really done backups of my server my self (even though I should have). Iā€™ll have to take a look into it.

Do you have BASH experience?

1 Like

@michacassola As @Eliter advanced (as an alternative) you can:

  1. Use a custom bash script to *.tgz your desired folders to a custom folder (letā€™s say /home/backups/ ) and cronjob *.tgz files to be created (letā€™s say daily at 23:14h)

  2. Use external apps (or web services) to sync your /home/backups/ content to a GoogleDrive folder (lets say, /miab/backups/), daily at 23:59h by using tools like Microsoft Flow -> SFTP server to Google Drive or MultCloud.

  • If you donā€™t know how to create a bash script + cronjob for that task let me know it and Iā€™ll provide you an example of it.
1 Like

Just as an aside to @just4tā€™s comments.

MiaBā€™s scheduled backup time is at 03h00 each day server time.

Personally, I have a cron job running each day at 03h30 to rsync the backup to a different server.

@alento Just a question, why not use the build in rsync backup function from MiaB?

@Glennmen

With regards to this thread ā€¦ the OP is wanting to copy his backups to Google Drive.

With regards to my MiaBā€™s that I maintain, it is because the ā€˜storageā€™ server uses a non-default SSH port and I could not get it to work properly at the time. The time being BEFORE MiaB added the ability to backup using rsync. That functionality was added in v0.21. (Yes, I have been using MiaB since before then!) :slight_smile:
As it has worked flawlessly for me, I saw no reason to change my methodology.

1 Like

Thanks for your answer @just4t and @Eliter!
I do have some experience writing server hardening BASH scripts, but they are still basic.

I thought as we already have Duplicity we can use their functionality as they speak of Google Drive on their website and maybe it can be implemented in the software itself?

Of course I am always thankful to be pointed to tutorials where I can find the commands to write a custom script to do incremental verifyable backups of the emails and server stuff myself, I would just prefer this kind of functionality to be built in. I will never use software that I cannot backup easily.

  • If needed feel free and go ahead to code it and test it and when done create a PR to be added. Who knows! perhaps @JoshData could accept to merge it.

I just tested the Multcloud alternative I told you before in this post and works very well and you will not need to create or run custom bash script(s) to have a copy of your backups into your GoogleDrive account (keep in mind that task scheduling is not included if running their FREE plan :confused: ) ā€¦

Required:

  • Dedicated SSH key pair without password
  • Default Mail-in-a-Box local backup feature enabled.

Then:

  1. Config. a Multcloud SFTP cloud drive with path /home/user-data/backup/encrypted
  2. Config. a Multcloud GoogleDrive cloud drive with path /box_backups
  • Create a Multcloud Cloud Sync task by setting 1) as the source and 2) as the destination.

Hope this helps

Yes, this should be possible, though I believe you are right that only a couple of backends are exposed through the user interface.

I think you would need to pip install pydrive, but then you should be able to test backing something up to Google from the duplicity command line. Just ask on the duplicity mailing list if you have any trouble.

Once that is working there may be a way to change the miab backup settings to use it, or you may just have to make your own Cron job.

@JoshData ā€“ did you deliberately restrict the backends or would you like others added?

Itā€™s not intentional, but adding options creates more work!

Iā€™ve used rclone for several years now to copy the backup folder onto Google Drive and also Onedrive. Works flawless. Itā€™s easy to install rclone and the backup can be created with a one line script:

/usr/bin/rclone --config ā€œ/usr/bin/rclone.confā€ copy /home/user-data/backup/encrypted ā€œbackup:/Email Backupsā€

It might be a learning curve to put it all together, to learn how to schedule the script and install/configure rclone initially. rclone can also add another level of encryption albeit itā€™s not really needed.

1 Like

This topic was automatically closed after 61 days. New replies are no longer allowed.