- State caching
- Real-Time file monitoring with Inotify
- Resumable uploads
- Support OneDrive for Business (part of Office 365)
- Shared folders are not supported
- While local changes are uploaded right away, remote changes are delayed
- No GUI
sudo apt-get install libcurl4-openssl-dev
sudo apt-get install libsqlite3-dev
curl -fsS https://dlang.org/install.sh | bash -s dmd
sudo yum install libcurl-devel
sudo yum install sqlite-devel
curl -fsS https://dlang.org/install.sh | bash -s dmd
git clone https://github.com/skilion/onedrive.git
cd onedrive
make
sudo make install
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.
sudo make uninstall
# delete the application state
rm -rf .config/onedrive
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:
mkdir -p ~/.config/onedrive
cp ./config ~/.config/onedrive/config
nano ~/.config/onedrive/config
Available options:
sync_dir
: directory where the files will be syncedskip_file
: any files or directories that match this pattern will be skipped during sync.
Patterns are case insensitive. *
and ?
wildcards characters are supported. Use |
to separate multiple patterns.
Note: after changing skip_file
, you must perform a full synchronization by executing onedrive --resync
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 of the file represents a path to a file or directory relative from your sync_dir
.
Here is an example:
Backup
Documents/latest_report.docx
Work/ProjectX
notes.txt
Note: after changing the sync list, you must perform a full synchronization by executing onedrive --resync
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
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:
onedrive --monitor --confdir="~/.config/onedrivePersonal" &
onedrive --monitor --confdir="~/.config/onedriveWork" &
--monitor
keeps the application running and monitoring for changes
&
puts the application in background and leaves the terminal interactive
If you encounter any bugs you can report them here on Github. Before filing an issue be sure to:
- Have compiled the application in debug mode with
make debug
- Run the application in verbose mode
onedrive --verbose
- Have the log of the error (preferably uploaded on an external website such as pastebin)
- Collect any information that you may think it is relevant to the error (such as the steps to trigger it)
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.
The files and directories in the synchronization directory must follow the Windows naming conventions. 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.