Backup - Google Drive Script

Just curious to see if anyone has tried this from the Vesta forum?

[Automatically upload users (and admin) backup files to Google Drive]

https://forum.vestacp.com/viewtopic.php?f=19&t=14277

There can be some code found in the backup script

See https://github.com/hestiacp/hestiacp/blob/eda332a7c3e35a56851eae02f225bd4328879825/bin/v-backup-user

# Defining google settings
source $HESTIA/conf/google.backup.conf
gsutil="$HESTIA/3rdparty/gsutil/gsutil"
export BOTO_CONFIG="$HESTIA/conf/.google.backup.boto"

Just checked $HESTIA/3rdparty doesn’t exsists so it need some work.

How ever feel free to contribute on it…

When I first read this thread I was very skeptical about uploading Hestia backup files to Google Drive. Especially if the backup files contained other people’s data (web sites, emails etc). But then I went through the bash script code and saw that the files are encrypted before being sent to Google Drive :slight_smile:

Apologies for the semi off-topic, but I thought the information that backups to G-Drive will be encrypted, might be valuable to quite a few people.

2 Likes

I found this article

I will test it in the next days

1 Like

this should work as it uses just fuse to mount a drive. maybe not in containers (LXC/OVZ) were you often enough need fuse enabled by the provider though.

I do something similar with sshfs/autofs - however, you should keep in mind, that the backup process first put the files seperately in a temp folder there before finally create a single archive. this means if use such a fuse mount the data needs to be transferred there temporary first and then read back only to be written into the final zstd in the end…

if you’re backups tend to be big, this will probably be time consuming and slow, so you rather want to find a way to keep the temporary data local.

you are right.

setup a google drive like a backup option is an hard work. I’m not a great developer…

You might want to investigate using restic along with rclone to access Google Drive.
The setup is a bit fiddly, but once its working, its great. You can set a policy simply like “keep monthly backups for 3 months, weekly ones for 3 weeks and daily ones for 5 days” and it just figures things out, meaning you can restore to any point in time.
If you want databases backed up as well as files, you’d have to dump them to disk.
Then I guess you just exclude them from the local backup, which is still needed for user config etc.
Restic handles all the complicated backup stuff, deduplication, encryption, etc, and your backup script can just be one line at its simplest.