Minor quirk with Google Drive Upload

SYSTEM INFORMATION
OS type and version CentOS Stream Linux 9
Webmin version 2.105
Virtualmin version 7.9.0 Pro
Related packages SUGGESTED

Switched to Google Drive from Dropbox for my off site domain backups, which works great from a speed standpoint, it’s about 1/3 of the time it takes to get the job done with Dropbox. However, I noticed a quirk.

When I upload to Google Drive, it doesn’t put the resultant files in the same structure as Dropbox (and a local copy) despite using the same command. These are the commands that I’m telling Virtualmin to use:

Local: /serverbu/backup_%m_%d_%Y_%H_%M
Dropbox: virtualmin/backup_%m_%d_%Y_%H_%M
Google Drive: virtualmin/backup_%m_%d_%Y_%H_%M

Using an example of one of my domains here: (black-sabbath.com), what I get for each is this:

Local put today’s backup files in a directory called backup_12_18_2023_00_01 and I get three files. They are black-sabbath.com.tar.gz, black-sabbath.com.tar.gz.dom, & black-sabbath.com.tar.gz.info.

Dropbox does the same thing. This is what I want. However, Google Drive using the same “folder & path” string results in this:

I get them in the virtualmin directory, but the files look like this:

backup_12_18_2023_00_01 black-sabbath.com.tar.gz

It’s not creating the additional directory with the date and time, it’s appending the date and time to the filename. Local doesn’t do that, Dropbox doesn’t do that, but Google Drive does. It’s not the end of the world, the files are getting there, I can massage them myself afterwards to be in the right spot, but I wonder why it’s not putting them there the same way that local and Dropbox are.

I did check, the “create destination directory” is checked.

Suggestions?

Thanks for the heads up!

@Jamie, do you remember I mentioned this in a private discussion? Could you comment on this?

1 Like

Oh I think this is a bug in the Google Drive support for folders - we don’t support sub-folders yet, only a top-level folder. So a folder like virtualmin-backup_%m_%d_%Y_%H_%M would work …

I will look into fixing this and update this ticket with progress …

2 Likes

Tried that - that just creates multiple directories in my Google Drive root, which I don’t want either, I wanted them in the virtualmin directory I have for these things. Mine at least puts them in there if not named correctly.

Tkx for looking into it.

Additionally, when I tried using that in my scheduled backup, the software threw an error.

" Failed to save scheduled backup : Deletion of old backups cannot be enabled, as the base directory could not be extracted from the destination path. It must be a path like /backup/virtualmin-%d-%m-%Y, and cannot be a top-level directory"

When you got that error, what did you enter the backup path as exactly?

The thing you suggested a few messages up.

virtualmin-backup_%m_%d_%Y_%H_%M

Try entering it with a / at the start, like /virtualmin-backup_%m_%d_%Y_%H_%M

Virtualmin didn’t like that. It threw an immediate error:

" Backup failed : Google Drive path cannot start or end with a slash"

Oh I see the bug that causes this, sorry. It’s fixed in this patch : Google Drive folder can also be date-based 00~https://forum.virtualmi… · virtualmin/virtualmin-gpl@8aff197 · GitHub

And we’ll include this in the next Virtualmin release.

1 Like

Danke. Look forward to getting the fix.

Also, the next Virtualmin release will support backing up to sub-folders in Google Drive…

2 Likes

Any ETA on this update?

you can implement the code fix yourself - it is a GPL licence. Or simply wait for the next version release. But there are no published schedule for such events AFAIK.