From f00a80bcac8d6b66ebd8d53c31d2fc70dddc9aac Mon Sep 17 00:00:00 2001 From: skilion Date: Fri, 16 Jun 2017 16:44:48 +0200 Subject: [PATCH] update documentation --- README.md | 119 +++++++++++++++++++++++++++++++++++------------------- 1 file changed, 77 insertions(+), 42 deletions(-) diff --git a/README.md b/README.md index 882c0225..9b619b68 100644 --- a/README.md +++ b/README.md @@ -1,97 +1,132 @@ -OneDrive Free Client -==================== +# OneDrive Free Client +###### A complete tool to interact with OneDrive on Linux. Built following the UNIX philosophy. ### Features: * State caching * Real-Time file monitoring with Inotify * Resumable uploads +* Support OneDrive for Business (part of Office 365) ### What's missing: -* OneDrive for business is not supported -* While local changes are uploaded right away, remote changes are delayed. +* Shared folders are not supported +* While local changes are uploaded right away, remote changes are delayed * No GUI +## Setup + ### Dependencies * [libcurl](http://curl.haxx.se/libcurl/) * [SQLite 3](https://www.sqlite.org/) * [Digital Mars D Compiler (DMD)](http://dlang.org/download.html) -### Dependencies: Ubuntu -``` -sudo apt-get install libcurl-dev +### Dependencies: Ubuntu/Debian +```sh +sudo apt-get install libcurl4-openssl-dev sudo apt-get install libsqlite3-dev +# install DMD sudo wget http://master.dl.sourceforge.net/project/d-apt/files/d-apt.list -O /etc/apt/sources.list.d/d-apt.list wget -qO - http://dlang.org/d-keyring.gpg | sudo apt-key add - sudo apt-get update && sudo apt-get install dmd-bin ``` ### Installation -``` -git clone git@github.com:skilion/onedrive.git +```sh +git clone https://github.com/skilion/onedrive.git cd onedrive make sudo make install ``` -### Configuration: -You should copy the default config file into your home directory before making changes: +### First run :zap: +After installing the application you must run it at least one time from the terminal to authorize it. The procedure requires a web browser. +You will be asked to open a specific link where you will have to login into your Microsoft Account and give the application the permission to access your files. After giving the permission, you will be redirected to a blank page. Copy the URI of the blank page into the application. + +### Uninstall +```sh +sudo make uninstall +# delete the application state +rm -rf .config/onedrive ``` + +## Configuration +Configuration is optional. By default all files are downloaded in `~/OneDrive` and only hidden files are skipped. +If you want to change the defaults, you can copy and edit the included config file into your `~/.config/onedrive` directory: +```sh mkdir -p ~/.config/onedrive cp ./config ~/.config/onedrive/config +nano ~/.config/onedrive/config ``` Available options: * `sync_dir`: directory where the files will be synced -* `skip_file`: any files or directories that match this pattern will be skipped during sync +* `skip_file`: any files or directories that match this pattern will be skipped during sync. -Pattern are case insensitive. -`*` and `?` [wildcards characters][1] are supported. -Use `|` to separate multiple patterns. +Patterns are case insensitive. `*` and `?` [wildcards characters](https://technet.microsoft.com/en-us/library/bb490639.aspx) are supported. Use `|` to separate multiple patterns. -[1]: https://technet.microsoft.com/en-us/library/bb490639.aspx +Note: after changing `skip_file`, you must perform a full synchronization by executing `onedrive --resync` -### Selective sync +### Selective sync :zap: Selective sync allows you to sync only specific files and directories. To enable selective sync create a file named `sync_list` in `~/.config/onedrive`. -Each line represents a path to a file or directory relative from your `sync_dir`. -``` -$ cat ~/.config/onedrive/sync_list +Each line of the file represents a path to a file or directory relative from your `sync_dir`. +Here is an example: +```text Backup -Documents/report.odt +Documents/latest_report.docx Work/ProjectX notes.txt ``` +Note: after changing the sync list, you must perform a full synchronization by executing `onedrive --resync` -### First run -The first time you run the program you will be asked to sign in. The procedure requires a web browser. - -### Service +### OneDrive service If you want to sync your files automatically, enable and start the systemd service: -``` +```sh systemctl --user enable onedrive systemctl --user start onedrive ``` To see the logs run: -``` +```sh journalctl --user-unit onedrive -f ``` -### Usage: -``` -onedrive [OPTION]... - --m --monitor Keep monitoring for local and remote changes. - --resync Forget the last saved state, perform a full sync. - --logout Logout the current user. - --confdir Set the directory to use to store the configuration files. --v --verbose Print more details, useful for debugging. --h --help This help information. +### Using multiple accounts +You can run multiple instances of the application specifying a different config directory in order to handle multiple OneDrive accounts. +To do this you can use the `--confdir` parameter. +Here is an example: +```sh +onedrive --monitor --confdir="~/.config/onedrivePersonal" & +onedrive --monitor --confdir="~/.config/onedriveWork" & ``` -### Notes: -* After changing `skip_file` in your configs or the sync list, you must execute `onedrive --resync` -* [Windows naming conventions][2] apply -* Use `make debug` to generate an executable for debugging +`--monitor` keeps the application running and monitoring for changes -[2]: https://msdn.microsoft.com/en-us/library/aa365247 +`&` puts the application in background and leaves the terminal interactive + +## Extra + +### Reporting issues +If you encounter any bugs you can report them here on Github. Before filing an issue be sure to: + +1. Have compiled the application in debug mode with `make debug` +2. Run the application in verbose mode `onedrive --verbose` +3. Have the log of the error (preferably uploaded on an external website such as [pastebin](https://pastebin.com/)) +4. Collect any information that you may think it is relevant to the error (such as the steps to trigger it) + +### All available commands: +```text +Usage: onedrive [OPTION]... + +no option Sync and exit. +-m --monitor Keep monitoring for local and remote changes. + --resync Forget the last saved state, perform a full sync. + --logout Logout the current user. + --confdir Set the directory to use to store the configuration files. +-v --verbose Print more details, useful for debugging. + --print-token Print the access token, useful for debugging. +-h --help This help information. +``` + +### File naming +The files and directories in the synchronization directory must follow the [Windows naming conventions](https://msdn.microsoft.com/en-us/library/aa365247). +The application will crash for example if you have two files with the same name but different case. This is expected behavior and won't be fixed.