Author Topic: onedrive synchronisation  (Read 605 times)

Offline haplo

  • Newly Subscribed
  • *
  • Posts: 5
  • Karma: 0
  • New Forum User
    • View Profile
  • Peppermint version(s): 10
onedrive synchronisation
« on: December 07, 2019, 07:02:03 am »
Hi,

I have an office 365 account and have set up a onedrive sync using https://www.maketecheasier.com/sync-onedrive-linux/
I am now able to synchronize via a terminal and I want to start/resume this automatically when Iog in.

- I don't know how to do that. I also don't want a terminal to pop up each time I log in.
- When synchronization fails, it should automatically restart. I don't want to stop syncing because I lacked a wifi at login, for example.

How to do this?

Tx!

Offline PCNetSpec

  • Administrator
  • Hero
  • *****
  • Posts: 26452
  • Karma: 65531
  • "-rw-rw-rw-" .. The Number Of The Beast
    • View Profile
    • PCNetSpec
  • Peppermint version(s): Peppermint 10
Re: onedrive synchronisation
« Reply #1 on: December 07, 2019, 07:22:45 am »
How do you synchronise via the terminal .. what command(s) ?
WARNING: You are logged into reality as 'root' .. logging in as 'insane' is the only safe option.

Team Peppermint
PCNetSpec

Offline haplo

  • Newly Subscribed
  • *
  • Posts: 5
  • Karma: 0
  • New Forum User
    • View Profile
  • Peppermint version(s): 10
Re: onedrive synchronisation
« Reply #2 on: December 08, 2019, 05:59:58 am »
~$ onedrive --synchronize
for a one time sync is what I do now.

~$ onedrive --monitor
is what 'continuously' monitors for changes and syncs them, according to what is listed in the ~/onedrive/config config file.

Offline PCNetSpec

  • Administrator
  • Hero
  • *****
  • Posts: 26452
  • Karma: 65531
  • "-rw-rw-rw-" .. The Number Of The Beast
    • View Profile
    • PCNetSpec
  • Peppermint version(s): Peppermint 10
Re: onedrive synchronisation
« Reply #3 on: December 08, 2019, 06:20:15 am »
So basically you just want to autostart
Code: [Select]
onedrive --monitorat bootup ?



If so, try this...

Open a terminal and run:
Code: [Select]
xed ~/.config/autostart/onedrive-sync.desktopwhen a blank file opens, make it read
Code: [Select]
[Desktop Entry]
Type=Application
Name=Onedrive-Sync
Comment=Start the onedrive sync daemon at startup
Exec=bash -c "sleep 5 ; onedrive --monitor"
Icon=onedrive
Terminal=false
SAVE the file .. and log off/on to test.

The 'sleep 5' sets a delay of 5 seconds allowing the network time to become active .. you may need to adjust this.



If for some reason you need to run BOTH --synchronize then --monitor .. make the Exec line read
Code: [Select]
Exec=bash -c "sleep 5 ; onedrive --synchronize && onedrive --monitor"the && means - only run the next command if the first ran (and exited) successfully.
« Last Edit: December 08, 2019, 06:36:25 am by PCNetSpec »
WARNING: You are logged into reality as 'root' .. logging in as 'insane' is the only safe option.

Team Peppermint
PCNetSpec

Offline haplo

  • Newly Subscribed
  • *
  • Posts: 5
  • Karma: 0
  • New Forum User
    • View Profile
  • Peppermint version(s): 10
Re: onedrive synchronisation
« Reply #4 on: December 09, 2019, 01:21:39 pm »
Thank you very much. That unfortunately does not (yet) work for me.

After creating the file, logging out and back in again, I don't see the process in a later call ps -A | grep one
When I start the Exec line in a second terminal, i do see the running process later on.

Is there some log file I can check to see why the process was not started / was aborted / got killed?

Offline PCNetSpec

  • Administrator
  • Hero
  • *****
  • Posts: 26452
  • Karma: 65531
  • "-rw-rw-rw-" .. The Number Of The Beast
    • View Profile
    • PCNetSpec
  • Peppermint version(s): Peppermint 10
Re: onedrive synchronisation
« Reply #5 on: December 09, 2019, 02:37:12 pm »
did you try extending the sleep ?
WARNING: You are logged into reality as 'root' .. logging in as 'insane' is the only safe option.

Team Peppermint
PCNetSpec

Offline haplo

  • Newly Subscribed
  • *
  • Posts: 5
  • Karma: 0
  • New Forum User
    • View Profile
  • Peppermint version(s): 10
Re: onedrive synchronisation
« Reply #6 on: December 15, 2019, 01:55:05 am »
Hi, yes, up to 30 seconds.

When the call is executed from a terminal, it seems to work.

Can I trigger the auto-start applications from a terminal, so I don't need to log out and log in again each time? And is there a way to see if the call was really executed?