The problem is that it was installed as root, by running:
sudo ./install.sh #WRONG
so the .onedrive folder is owned by root. When you run onedrive-pref, it cannot write the configuration file config_v2.json into the folder because it doesn't have permissions. The installation script should be run as
./install.sh
and it will ask for permissions later. An update in the install.sh could be to ask the user at the beginning of the script if he really wants to install as root.
To fix it after installation I ran
sudo chown -R <username>:<group>~/.onedrive
where username and group are my local username and group, and then I ran onedrive-pref again.
how to query the group in which one user name ? using the following line:
The problem is that it was installed as root, by running:
sudo ./install.sh #WRONG
so the .onedrive folder is owned by root. When you run onedrive-pref, it cannot write the configuration file config_v2.json into the folder because it doesn't have permissions.
The installation script should be run as
and it will ask for permissions later. An update in the install.sh could be to ask the user at the beginning of the script if he really wants to install as root.
To fix it after installation I ran
where username and group are my local username and group, and then I ran onedrive-pref again.
how to query the group in which one user name ? using the following line:
groups <username>
three important command lines of onedrive:
oneconf-query
onedrive-pref
onedrive-d
onedrive-d --help:
与OneDrive同步一个本地文件夹
这里有两种方法来使用onedrice-d将本地文件夹与OneDrive存储同步。
一种是“手动使用命令行来同步OneDrive”。就是当你需要与你的OneDrive账户同步时运行如下命令:
onedrive-d接着将扫描本地文件夹与OneDrive帐户的内容并使两者同步。这意味着要么上传一个在本地文件夹新添加的文件,或者从远程OneDrive帐户下载最新发现的文件。如果你从本地文件夹删除任何文件,相应的文件将自动在与OneDrive帐户同步后被删除。反之亦然。
一旦同步完成,你可以使用Ctrl-C中断onedirve-d的前台进程。
另一种方法是将onedrive-d作为一个始终运行的守护进程在开机时自动启动。在这种情况下,后台守护进程会同时监视本地文件夹和OneDrive账户,以使它们保持同步。要做到这一点,只需将onedrive-D加入到你桌面的自动启动程序列表中就行了。
当onedrive-D作为守护进程在后台运行时,你会在桌面状态栏中看到OneDrive图标,如下图所示。每当同步更新被触发,你就会看到一个桌面通知。