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

    YannickH

    @YannickH

    1
    Reputation
    39
    Profile views
    2
    Posts
    0
    Followers
    0
    Following
    Joined
    Last Online

    YannickH Unfollow Follow

    Best posts made by YannickH

    • 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

    Latest posts made by YannickH

    • RE: Explaining cardDAV contacts sync script

      Hi @zlamalp,
      I have to tell you that my solution is not really working.
      Indeed, when I gave you my answer, I've forgotten that I had changed the way I create the /sbin/sogosync file.

      In fact, after the creation by running the original script, I modified this file manually in console mode :
      sudo mount / -o remount,rw
      sudo vi /sbin/sogosync
      Then I edited the file in order to fit with the following lines :

      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 data_base_name
      

      Note : in the above line data_base_name is to be replace by the name of your database.
      Then at each execution by cron daemon, the string DBUS_SESSION_BUS_ADDRESS is evaluated.
      It would be nice if the original script would be able to put this line in the file itself but I'm not an expert in shell programming so I've no solution to propose.

      posted in Support
      Y
      YannickH
    • 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