Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issues with using snap version of onedrive-cli (Ubuntu 18.04) #1

Closed
jdpipe opened this issue Aug 21, 2023 · 5 comments
Closed

Issues with using snap version of onedrive-cli (Ubuntu 18.04) #1

jdpipe opened this issue Aug 21, 2023 · 5 comments

Comments

@jdpipe
Copy link

jdpipe commented Aug 21, 2023

Thanks so much for making this Snap version of the OneDrive for Linux client! With a bit of fiddling, I was able to make it work for synching a so-called "OneDrive SharePoint Shared Library". So far just manual sync, and no GUI, but still, it's very useful.

I just wanted to flag that many of the instructions become quite hard to follow with Snap because of the limitations that exist on writable folders for Snap. I found that I had to place my synchronised files in this folder:

~/snap/onedrive-cli/current/PROJECTNAME

(noting this is a symlink to ~/snap/onedrive-cli/1/PROJECTNAME)

Then, I had to put my config file in

~/snap/onedrive-cli/current/.config/PROJECTNAME/config

In the config file, I had to refer to the project folder as simple

sync_dir = "PROJECTNAME"

HERE IS THE ISSUE, HOWEVER:

Shouldn't the onedrive-cli snap be storing my synchronised files in $SNAP_USER_COMMON instead of $SNAP_USER_DATA? Without doing this, everytime the snap is upgraded, it will have to make a copy of ~/snap/onedrive-cli/1/PROJECTNAME to ~/snap/onedrive-cli/2/PROJECTNAME. Isn't that right? Wouldn't it make sense to keep the synchronised files in the common area, so that they don't need to be copied?

For users with limited disk space, this could lead to challenging issues, if I understand it correctly.

@boukendesho
Copy link
Owner

boukendesho commented Aug 21, 2023

Without doing this, everytime the snap is upgraded, it will have to make a copy of ~/snap/onedrive-cli/1/PROJECTNAME to ~/snap/onedrive-cli/2/PROJECTNAME. Isn't that right?

Yes, exactly!

I have very few files, so I didn't notice the disk usage problem. This is indeed a very good suggestion. I will update the documentation to advise users to put their files in $SNAP_USER_COMMON. Thank you very much!

@boukendesho
Copy link
Owner

boukendesho commented Aug 21, 2023

I'll need some time to test and see if it's possible to change the default data dir to $SNAP_USER_COMMON.

@jdpipe
Copy link
Author

jdpipe commented Aug 21, 2023

Yes, I think it's more than just a documentation change, unfortunately. The errors that you get when using the snap version of Onedrive are not very helpful. I didn't know that Snap in general has this folder access limitation, so the error messages were quite puzzling.

@boukendesho
Copy link
Owner

@jdpipe Hi, sorry for keep you waiting so long.

I did some tests, and you can try to let your 'sync_dir = /home/YourUSER'/PROJECTNAME'.

By using absolute paths, you can completely avoid default snap dir. But config file dir will still in snap default home dir(/home/YourUSER/snap/onedrive-cli/current/.config/onedirve)

@boukendesho
Copy link
Owner

And I've found that making SNAP_USER_COMMON the default folder is very difficult; it would require upstream adding some Snap sepcific code due to the special SNAP environment variables.

onedrive default sync_dir is '~/OneDrive', which is ok in normal linux distro, but

In a Snap app, the default $HOME variables is /home/$USER/snap/$SNAP_NAME/$SNAP_REVISION

and the $SNAP_REAL_HOME env variables is the actual real home path.This requires the program to actively call it instead of default '~'.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants