ChaoticTrials / SimpleBackups

A simple mod to create scheduled backups
https://modrinth.com/mod/simple-backups
Apache License 2.0
10 stars 6 forks source link

Able to Upload the backup to google drive #25

Closed yesnonr closed 3 weeks ago

yesnonr commented 7 months ago

Describe your idea

This will help with cloud hosting

EchoTiger commented 3 months ago

I had the same idea, but settled with using Google Drive Adapter. https://github.com/andresoviedo/google-drive-ftp-adapter This allows FTP access to your Google Drive, which I wrote a quick script to automatically push the backups to FTP once a file change is detected using Node and "fs.watch"

HoldYourWaffle commented 3 weeks ago

I agree with this idea in spirit, but managing cloud storage is notoriously tricky to implement reliably. Given that failure could be disastrous (lost backups) I'd strongly recommend leaving this to dedicated tools and not complicate the mod any further than "write file to disk". Maintaining one cloud provider implementation might be doable (though I have only heard negative things about Google Drive in this respect), but soon requests will come in for supporting OneDrive, Dropbox, (S)FTP, S3, NFS, SMB and every other obscure system you can think of 🥲

It'd be great if a mechanism for "run this script when a backup has been made" (passing an absolute path) could be added. This would be super useful for setting up those tools reliably, file watchers can be flimsy from time to time.

MelanX commented 3 weeks ago

I like the idea of having a script to execute instead of a specific service. I’d like to add a pre- and post-backup script config. I do have two ideas for that:

  1. Add a string config for setting the terminal command to be executed.
  2. Add two files in a folder called pre-backup-script and post-backup-script and these will be executed. A small description in the files as well.

I'm just not sure about security. When a pack dev adds files/commands that do something malicious, how would someone notice? I’m opening a thread for easier discussion on my discord at https://discord.chaotictrials.de/, feel free to join and comment(s)! Comments here are welcome, too :)

J0B10 commented 3 weeks ago

We've already discussed this on Discord, so I'll refrain from repeating my comments.

Nevertheless, I'dd like to make you aware of a possible solution that I have proposed, which can already be used today:

rclone is a tool for syncing files to cloud storage. It supports a lot of plattforms (including all named before), while the rclone mount command can be used to create a mountpoint in your filesystem for the remote. This way you can basically save the backups directly to the cloud by just specifying the mount point as outputPath in the SimpleBackups config.

Follow the provided links to the documentation for more information. A quick note: I suggest adding the flag --vfs-cache-mode writes to rclone mount command, as local caching is required for reliable backups.

MelanX commented 3 weeks ago

Here's the exact link to the thread on Discord: https://discord.com/channels/1249315926197932074/1273586005802356849 I will not add this feature in Simple Backups. Here's my decision message from Discord:

I think that the main usage for this will be using a MC server hoster, not a VPS or similar. That's a reason why I would like to add it. However, it seems to be a bit overkill as Jonas said. I think it should be a separate tool/mod which can be added by a server owner itself. This tool/mod shouldn't even be published on Modrinth or CurseForge, so that it's more difficult to add it to a modpack. Sure, GitHub releases are allowed in Modrinth packs, but maybe there's a way to let moderators of Modrinth know that this mod shouldn't be allowed in packs but instead the server owner should download it on its own.

I will close the issue on GitHub for now. When anyone created a mod like this, let me know! I will then advertise it on the project site of Simple Backups, add a link in the issue, and maybe a little note in the config. When I finally added a wiki for Simple Backups, it would be included in that as well :D