Use google drive to backup and synchronize appdata? - google-drive-api

Can gDrive be used to backup application-specific data files, i.e. game save states that are not traditionally user facing? Would this allow cross-device migration?

Yes, this is possible. Drive apps can create files with arbitrary MIME types. Synchronization is therefore available by downloading the file(s) from multiple places/devices.

Related

Is there a way to set a file to read only in GODOT

I am saving data as part of a game, using a CSV file, and want to set it to read-only so that the user cannot modify it (system designed for not very experienced users).
Is there any way to save these files so that they are read-only?
Unfortunately it seems that godot's File API does not provide a mechanism to change file permissions. You could try using an encrypted file, which will prevent the user from trivially viewing it as a CSV file (e.g. it shouldn't open by default in their spreadsheet program). However, an encrypted file can still be overwritten and corrupted, and this will hinder modding for players that enjoy digging around game files.
You could write a proposal to include permissions functionality in the File API, or write the saving code in a language other than GDScript, where you'd have access to a standard library with this functionality. You could write a GDNative extension that supports this.
Ultimately you have to decide how important it is to fool-proof your system. A determined user will find ways to break things.

Backup Google Shared Drive files and folders

In our company, we use Google Enterprise, and Shared Drives to store all our documents. After chatting with Google support agents, it seems there is no way to backup some of our folders and files.
We have two different needs:
- keeping a regularly syynchronized backup of some sensible files updated regularly
- backing up every month some files as they are on the backup date, and creating a specific copy for each monthly backup
Anyone has a way to do either of those things?
thanks
You need to write a program/script based on the Google Drive API https://developers.google.com/drive/api/v3/about-sdk
Or, try a third-party Google Enterprise data backup tool, like CubeBackup or Spanning.

Transfer files from dropbox/drive to Google cloud storage

We are planning to implement a feature to let customers browse their images in their own google drive or dropbox accounts (within our app), and select ones they wanna use in our app. Then, we will save these images into our Google cloud storage (GCS) place.
A simple approach is to use OAuth to download the customers' images from dropbox/drive to our local disk, then upload them to our GCS.
I am wondering if it is possible to make a direct transfer between dropbox/drive and GCS? GCS does provide transfer service for S3. You can also create a list of URL list, but each URL needs to be publicly accessible, which in our case does not seem possible.
Is there any better suggestion on how to implement this feature? Thanks
Well you could stream the files so at least you wouldn't have to save them to local disk, but other than that I think your solution is the way to go.
It depends on your language how streaming works exactly, but basically you download the file and upload it to GCS right away without ever writing any bytes to local disk.
I ran into your question during my search of finding a way to transfer data from G-drive to Google Cloud Storage. Since they are both under Google umbrella, so I guess they should be able to seamlessly upload/download. So far in my search, without programming, the answer is NO.
I don't have a exactly solution for your question, because it really depend on how much data you have and how often of the uploading/downloading. Unfortunately, there is not straight shot (even for the Gdrive!). But maybe thinking of trying the RESTful API calling to Google and make the connection with Dropbox API. Hoping this could help.
With this recipe, you can use Google Colab to mount Google Drive folder, and then copy from the mounted folder to the storage bucket using gsutil, avoiding the need to first save the data to local disk.

Google Realtime API - Using Collaborative Models with Files

Trying to understand this help doc. It says:
The Realtime API provides a persistent document for the data that
users are collaborating on.
What is this "persistent document"? Is this a file in Google Drive? I'm not planning to store data in Google Drive and most likely will be using shortcut files. So how does that relate to my situation?
Applications that provide collaborative
editing features, but need to work with files in various formats, must
adopt one or more strategies for converting data between the Realtime
API document and other file formats.
I'm storing my data as XML in database. Does this qualify for "files in various formats"? How does that effect my situation?
Each file on Drive has content as itself and a permanent storage for Realtime API. In your case, your shortcut files will have Realtime structures even though your files wont have any content all.

how to sync files from mysql hosting site to google drive

We are creating a web application using MySQL as our database, is there a way that some files from the hosting site of our application can be sync to the user's google drive?
There's no direct way of synchronizing your local data with Drive.
However, you can pseudo-sync with little load on your server by using Changes. Basically, you can get list of file changes since the time you specify. If I were you, I make a cron job of checking file changes from Drive and Files.get specific files that have changed.
Besides what JunYoung Gwak suggests -> to ask google by polling them you will also have to keep a last edited date in your app and there might be cases when the local file is newer. will have to keep the same time zone as google to make it work for <24 hour changes.
So both sides will need to have a give changes since -date-time-in-timezone and a way to take a file for one place and update to the other.
Might have conflicts that need to be resolved by a diff tool.