UBports Robot Logo UBports Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login
    1. Home
    2. YannickH
    3. Best
    Y
    Offline
    • Profile
    • Following 0
    • Followers 0
    • Topics 0
    • Posts 2
    • Groups 0

    Posts

    Recent Best Controversial
    • RE: Explaining cardDAV contacts sync script

      Hi zlamalp,

      I faced the same issue when I wanted to put in place sync script.
      I'm using the script given in link on this page :
      https://docs.ubports.com/en/latest/userguide/advanceduse/dav.html
      The script is on git repository :
      https://gist.github.com/boTux/069b53d8e06bdb9b9c97

      I don't know if the script you use is the same (line 27 is different).
      Nevertheless, when I used this script, the sync doesn't work anymore after reboot of the phone.
      It's because the following command :

      DBUS_SESSION_BUS_ADDRESS=$(ps -u phablet e | grep -Eo 'dbus-daemon.*address=unix:abstract=/tmp/dbus-[A-Za-z0-9]{10}' | tail -c35)
      

      doesn't return the same value after a reboot.
      So you have to evaluate it after each reboot.

      To do so, I changed the lines number 96 to 100 (in the script) by these ones :

      CRON_FREQUENCY="hourly"
      
      sudo mount / -o remount,rw
      COMMAND_LINE="export DISPLAY=:0.0 && export DBUS_SESSION_BUS_ADDRESS=$(ps -u phablet e | grep -Eo 'dbus-daemon.*address=unix:abstract=/tmp/dbus-[A-Za-z0-9]{10}' | tail -c35) && /usr/bin/syncevolution $OC_DATABASE_NAME"
      sudo sh -c "echo '$COMMAND_LINE' > /sbin/sogosync"
      sudo chmod +x /sbin/sogosync
      
      CRON_LINE="@$CRON_FREQUENCY /sbin/sogosync"
      (crontab -u phablet -r;) # only if no other cronjob already exist in the crontab
      (crontab -u phablet -l; echo "$CRON_LINE" ) | crontab -u phablet -
      sudo mount / -o remount,ro
      sudo service cron restart
      

      With these modification, the value is evaluate et each reboot.

      Hope it will help you,

      Yannick

      posted in Support
      Y
      YannickH