[Translated]How to sync Microsoft OneDrive on Linux

This commit is contained in:
geekpi 2014-06-26 11:26:23 +08:00
parent 1000898b5e
commit f63dc9d447
2 changed files with 81 additions and 84 deletions

View File

@ -1,84 +0,0 @@
Translating--------------geekpi
How to sync Microsoft OneDrive on Linux
================================================================================
[OneDrive][1] (previously known as SkyDrive) is a popular cloud storage offering from Microsoft. Currently OneDrive offers 7GB free storage for every new signup. As you can imagine, OneDrive is well integrated with other Microsoft software products. Microsoft also offers a standalone OneDrive client which automatically backs up pictures and videos taken by a camera to OneDrive storage. But guess what. This client is available for all major PC/mobile platforms except Linux. "OneDrive on any device, any time"? Well, it is not there, yet.
Don't get disappointed. The open-source community already has already come up with a solution for you. [onedrive-d][2] written by a Boilermaker in Lafayette can get the job done. Running as a monitoring daemon, onedrive-d can automatic sync a local folder with OneDrive cloud storage.
In this tutorial, I will describe **how to sync Microsoft OneDrive on Linux by using onedrive-d**.
### Install onedrive-d on Linux ###
While onedrive-d was originally developed for Ubuntu/Debian, it now supports CentOS/Fedora/RHEL as well.
Installation is as easy as typing the following.
$ git clone https://github.com/xybu92/onedrive-d.git
$ cd onedrive-d
$ ./inst install
### First-Time Configuration ###
After installation, you need to go through one-time configuration which involves granting onedrive-d read/write access to your OneDrive account.
First, create a local folder which will be used to sync against a remote OneDrive account.
$ mkdir ~/onedrive
Then run the following command to start the first-time configuration.
$ onedrive-d
It will pop up a onedrive-d's Settings window as shown below. In "Location" option, choose the local folder you created earlier. In "Authentication" option, you will see "You have not authenticated OneDrive-d yet" message. Now click on "Connect to OneDrive.com" box.
![](https://farm4.staticflickr.com/3885/14470579955_1fb92e7cfe.jpg)
It will pop up a new window asking you to sign in to OneDrive.com.
![](https://farm4.staticflickr.com/3903/14467221981_3d74140f61_z.jpg)
After logging in to OneDrive.com, you will be asked to grant access to onedrive-d. Choose "Yes".
![](https://farm3.staticflickr.com/2925/14283963819_86cf52e1fd_z.jpg)
Coming back to the Settings window, you will see that the previous status has changed to "You have connected to OneDrive.com". Click on "OK" to finish.
![](https://farm4.staticflickr.com/3896/14284004048_3e718d1e30.jpg)
### Sync a Local Folder with OneDrive ###
There are two ways to sync a local folder with your OneDrive storage by using onedrive-d.
One way is to **sync with OneDrive manually from the command line**. That is, whenever you want to sync a local folder against your OneDrive account, simply run:
$ onedrive-d
`onedrive-d` will then scan the content of both a local folder and a OneDrive account, and make the two in sync. This means either uploading newly added files in a local folder, or downloading newly found files from a remote OneDrive account. If you remove any file from a local folder, the corresponding file will automatically be deleted from a OneDrive account after sync. The same thing will happen in the reverse direction as well.
Once sync is completed, you can kill the foreground-running onedrive-d process by pressing Ctrl+C.
![](https://farm6.staticflickr.com/5509/14283967750_b9ebf1b05d_z.jpg)
Another way is to run onedrive-d as an always-on daemon which launches automatically upon start. In that case, the background daemon will monitor both the local folder and OneDrive account, to keep them in sync. For that, simply add onedrive-d to the [auto-start program list][3] of your desktop.
When onedrive-d daemon is running in the background, you will see OneDrive icon in the desktop status bar as shown below. Whenever sync update is triggered, you will see a desktop notification.
![](https://farm4.staticflickr.com/3924/14290119448_3b1144db77.jpg)
A word of caution: According to the author, onedrive-d is still under active development. It is not meant for any kind of production environment. If you encounter any bug, feel free to file a [bug report][4]. Your contribution will be appreciated by the author.
--------------------------------------------------------------------------------
via: http://xmodulo.com/2014/06/sync-microsoft-onedrive-linux.html
译者:[译者ID](https://github.com/译者ID) 校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
[1]:http://xmodulo.com/go/onedrive
[2]:http://xybu.me/projects/onedrive-d/
[3]:http://xmodulo.com/2013/12/start-program-automatically-linux-desktop.html
[4]:https://github.com/xybu92/onedrive-d/issues?state=open

View File

@ -0,0 +1,81 @@
如何在Linux中同步微软 OneDrive
================================================================================
[OneDrive][1]以前称为SkyDrive是微软的一个广受欢迎的云存储产品。目前OneDrive为每一个新注册用户提供7GB免费存储空间。正如你所想OneDrive与微软其他软件产品很好地集成。微软还提供了一个独立的OneDrive客户端它会自动备份照相机拍摄的图片和视频到OneDrive。但你猜怎么着。该客户端可用于除Linux的各大PC/移动平台。 “OneDrive在任何设备任何时间”这还不存在。
不要失望。开源社区已经已经拿出了解决方案。 Boilermaker写的[onedrive-d][2]可以完成这项工作。作为监测守护进程运行onedrive-D可自动将本地文件夹同步到OneDrive云存储。
I在本教程中我将介绍**如何在Linux上使用onedrive-d同步微软OneDrive**。
### 在linux上onedrive-d ###
虽然onedrive-d最初是为Ubuntu/ Debian开发的但它仍然支持CentOS/ Fedora的/ RHEL。
安装就像输入下面的命令一样容易。
$ git clone https://github.com/xybu92/onedrive-d.git
$ cd onedrive-d
$ ./inst install
### 第一次配置 ###
安装之后你需要进行一次性配置来授予onedrive-d对您OneDrive账户的读/写权限。
首先创建将用于对远程OneDrive账户同步的本地文件夹。
$ mkdir ~/onedrive
接着运行下面的命令开开启一次性配置。
$ onedrive-d
它接着会弹出如下onedrive-d的设置窗口。在“Location”选项中选择你之前创建的本地文件夹。在“Authentication”选项中你会看见“You have not authenticated OneDrive-d yet”“你还没有授权OneDrive-d”的信息。现在点击"Connect to OneDrive.com"按钮。
![](https://farm4.staticflickr.com/3885/14470579955_1fb92e7cfe.jpg)
它会弹出一个新窗口来要求你登录OneDrivecom。
![](https://farm4.staticflickr.com/3903/14467221981_3d74140f61_z.jpg)
登录OneDrive.com之后你会被要求授权onedrive-d访问。选择“Yes”。
![](https://farm3.staticflickr.com/2925/14283963819_86cf52e1fd_z.jpg)
回到先前的设置窗口你会看到之前的状态已经变成了You have connected to OneDrive.com"“你已经连接到了OneDrive.com”。点击“OK”完成。
![](https://farm4.staticflickr.com/3896/14284004048_3e718d1e30.jpg)
### 与OneDrive同步一个本地文件夹 ###
这里有两种方法来使用onedrice-d将本地文件夹与OneDrive存储同步。
一种是“手动使用命令行来同步OneDrive”。就是当你需要与你的OneDrive账户同步时运行
$ onedrive-d
`onedrive-d`接着将扫描本地文件夹与OneDrive帐户的内容并使两者同步。这意味着要么上传一个在本地文件夹新添加的文件或者从远程OneDrive帐户下载最新发现的文件。如果你从本地文件夹删除任何文件相应的文件将自动在与OneDrive帐户同步后被删除。同样的事情也会在相反的方向发生。
一旦同步完成你可以使用Ctrl-C杀掉onedirve-d的前台运行进程。
![](https://farm6.staticflickr.com/5509/14283967750_b9ebf1b05d_z.jpg)
另一种方法是将onedrive-d作为一个始终运行的守护进程在开机时自动启动。在这种情况下后台守护进程会同时监视本地文件夹和OneDrive账户以使它们保持同步。对于这一点只需将onedrive-D加入到你桌面[自动启动程序列表][3]中就行了。
当onedrive-D作为守护进程在后台运行你会在桌面状态栏中看到OneDrive图标如下图所示。每当同步更新被触发你就会看到一个桌面通知。
![](https://farm4.staticflickr.com/3924/14290119448_3b1144db77.jpg)
要注意的是根据作者所言onedrive-d仍在积极开发中。这并不能用于任何形式的生产环境。如果您遇到任何bug请随时提交一份[bug报告][4]。你的贡献,笔者将不胜感激。
--------------------------------------------------------------------------------
via: http://xmodulo.com/2014/06/sync-microsoft-onedrive-linux.html
译者:[geekpi](https://github.com/geekpi) 校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
[1]:http://xmodulo.com/go/onedrive
[2]:http://xybu.me/projects/onedrive-d/
[3]:http://xmodulo.com/2013/12/start-program-automatically-linux-desktop.html
[4]:https://github.com/xybu92/onedrive-d/issues?state=open