abraunegg-onedrive/README.md

98 lines
2.7 KiB
Markdown
Raw Normal View History

2015-09-22 18:31:10 +02:00
OneDrive Free Client
====================
### Features:
* State caching
* Real-Time file monitoring with Inotify
2015-09-28 13:49:29 +02:00
* Resumable uploads
2015-09-22 18:31:10 +02:00
### What's missing:
* OneDrive for business is not supported
* While local changes are uploaded right away, remote changes are delayed.
* No GUI
2015-10-13 17:32:51 +02:00
### 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
sudo apt-get install libsqlite3-dev
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
```
2015-10-13 17:32:51 +02:00
### Installation
2016-12-25 20:53:46 +01:00
```
git clone git@github.com:skilion/onedrive.git
cd onedrive
make
sudo make install
```
2015-10-13 17:32:51 +02:00
2015-10-13 18:18:03 +02:00
### Configuration:
You should copy the default config file into your home directory before making changes:
```
mkdir -p ~/.config/onedrive
cp ./config ~/.config/onedrive/config
2015-10-13 18:18:03 +02:00
```
2015-09-22 18:31:10 +02:00
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
2015-09-22 18:31:10 +02:00
Pattern are case insensitive.
`*` and `?` [wildcards characters][1] are supported.
2015-09-22 18:31:10 +02:00
Use `|` to separate multiple patterns.
[1]: https://technet.microsoft.com/en-us/library/bb490639.aspx
### Selective sync
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
Backup
Documents/report.odt
Work/ProjectX
notes.txt
```
2015-09-22 18:31:10 +02:00
### First run
2016-12-04 21:54:43 +01:00
The first time you run the program you will be asked to sign in. The procedure requires a web browser.
2015-09-22 18:31:10 +02:00
2015-12-29 20:01:03 +01:00
### Service
If you want to sync your files automatically, enable and start the systemd service:
```
systemctl --user enable onedrive
systemctl --user start onedrive
```
To see the logs run:
```
journalctl --user-unit onedrive -f
```
2015-09-22 18:31:10 +02:00
### Usage:
```
onedrive [OPTION]...
2015-09-22 18:31:10 +02:00
-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.
```
2015-09-22 18:31:10 +02:00
### Notes:
* After changing `skip_file` in your configs or the sync list, you must execute `onedrive --resync`
* [Windows naming conventions][2] apply
2015-10-13 17:32:51 +02:00
* Use `make debug` to generate an executable for debugging
2015-09-22 18:31:10 +02:00
[2]: https://msdn.microsoft.com/en-us/library/aa365247