根据手册 https://github.com/abraunegg/onedrive/blob/master/docs/ubuntu-package-install.md#distribution-ubuntu-2204 安装onedrive
然后
# 根据提示登陆onedrive
onedrive
mkdir -p ~/.config/onedrive
# 输入同步的文件目录,一行一个 ,linux目录风格
nano ~/.config/onedrive/sync_list
# 先干跑预览(强烈推荐!确认只同步你想要的)
onedrive --synchronize --resync --dry-run --verbose
# 没问题再正式跑(会下载到 ~/OneDrive)
onedrive --synchronize --resync --verbose
# 启用并启动用户级 systemd 服务
systemctl --user enable onedrive
systemctl --user start onedrive
# 查看状态(应该 active running)
systemctl --user status onedrive
# 日志查看(有问题时用)
journalctl --user -u onedrive -f