bit-team / backintime

Back In Time - An easy-to-use backup tool for GNU/Linux using rsync in the back
https://backintime.readthedocs.io
GNU General Public License v2.0
2.07k stars 204 forks source link

Backup to OneDrive or Google Drive #1166

Closed KC-T closed 10 months ago

KC-T commented 3 years ago

Is it possible to back up to OneDrive or Google Drive? I have tried Rclone and Insync. Backintime cannot recognise the drives mapped by them.

buhtz commented 1 year ago

Please correct me if I'm wrong but rsync is not intended to work like this.

You have to mount your one/google/xyz drive to your locale filesystem. You can do this automatically via one of BITs user-callbacks.

I see no way to offer a solution implemented to BIT and vote for close.

emtiu commented 1 year ago

Many people use these cloud storage services, so it makes sense that users would like to use them as a backup storage destination.

But the approach of BackInTime and rsync is more like: We can write to any destination that is a locally mounted filesystem, or reachable by SSH.

Neither is natively supported by OneDrive or Google Drive, and so I agree that this is out of scope for BackInTime (and would probably be a lot of hassle to maintain if implemented).

buhtz commented 1 year ago

Dear @KC-T , can you give us some feedback about the issue please.

I have tried Rclone and Insync. Backintime cannot recognise the drives mapped by them.

That sounds interesting. What do you mean by "mapped"? You use BIT on GNU/Linux, right? Drives/Volumes are mounted somewhere else in the filesystem (usually under /mnt/* or /media/*). Where does "mapped" Google/OneDrive "drives" do appear in the filesystem? Or how do you see them in your system? Maybe you can add a snapshot?

EDIT: I found this about rclone. I'm not sure if I get it right but the OneDrive is not mapped to Linux. Rclone somewho connects to onedrive. The mounting then is done to the rclone-backup-entity (like a snapshot or backup image file). There is no direct connection between OneDrive and the filesystem. There is rclone in between. It looks like an ugly workaround.

In addition to emtiu's arguments I would say this is definitive nothing some of us would invest time in. Please ask Microsoft/Google to implement a native linux client so that their drives can be mounted to the filesystem.

KC-T commented 1 year ago

My question was raised in June 2021. OneDrive or Google Drive could not be mounted on Linux. I used Rclone and Insync to provide mapped folders (Microsoft Windows' term), but BackInTime could not recognise or back up to those folders. I did wish to use BackIntime to regularly back up to OneDrive or Google Drive. The BackInTime way is better than other incremental ways offered by other backup apps.

The final solution that I have adopted is to purchase Linux NAS and backup to there.

aryoda commented 1 year ago

Did you try the onedrive tool to connect to MS One Drive?

I am just wondering how a mapped folder would work with BiT since on Windows the folder contains local copies of the files that are then synced with the MS One Drive cloud.

So: May this lead to full backup into the sync folder only without any guarantee that the backup is really transferred into the cloud?

aryoda commented 1 year ago

I have done some investigations on MS OneDrive and I am quite sure now that we cannot directly support this (or similar) APIs because:

  1. The API is web-based (REST-API) and not support by rsync (which is the working horse used by BiT): https://learn.microsoft.com/en-us/graph/onedrive-concept-overview https://stackoverflow.com/questions/33756108/how-can-i-use-rsync-to-retrieve-files-from-an-http-url

  2. Mounting OneDrive with rclone (a FOSS solution for Linux since Microsoft does not provide any client to support OneDrive on Linux) does only provide a remote access to OneDrive via the REST API (either to directly the "remote" files in the cloud or by syncing it with a local folder). This means using the the rclone sync folder as BiT backup target folder

    • would waste a lot of disk space on your local storage (because it keeps the backup history)
    • does not guarantee to have a backup in the cloud since the syncing (via rclone) may fail anyhow

    So using a local sync folder is not recommended IMHO.

  3. "Any files you delete with rclone will end up in the trash. Microsoft doesn't provide an API to permanently delete files, nor to empty the trash, so you will have to do that with one of Microsoft's apps or via the OneDrive website." https://rclone.org/onedrive/

I propose

I am really sorry for that but we cannot circumvent the technical preconditions of rsync!

Germar commented 1 year ago

Even with native support for mounting a cloud-storrage, most times it won't work because of limited support for 'special' fileaccess which is used by BiT. For example I tried to use Box.net with BiT couple years ago. It wasn't possible because Box.net does not support neither hardlinks nor atime. Both are mandatory for BiT.

aryoda commented 1 year ago

THX Germar, this does explain why @KC-T reported

I have tried Rclone and Insync. Backintime cannot recognise the drives mapped by them.

To be added to our FAQ too...

Update 20.12.2023: I am working on the FAQ entry now...