Sync time across installs

  • Hi all,

    Only just started using Libreelec after a little while of using Openelec.

    I have an issue that I hope someone can help with, I'll explain my system first so hopefully that will help.

    I have two old revo r3600 boxes that are my clients, they aren'tkeeping time very well now since the battery is old and it hasn't helped that Acer decided to solder the battery to the wires that plug into the board.
    I have two PCs under my stairs, one is my unraid box and the other is another openelec box (waiting to be updated) that is also the box that has my DVB cards installed, so that streams to the two clients. It has no problem keeping time.

    Like I said, I can stream live tv but I can't get any EPG information because the time on the clients is out by so much (one client reverts back to 2009 every reboot) The EPG data is fine on the PVR box.

    I also have no internet so can't sync with an ntp server anywhere.

    After a little moochng about I've found a command that I can run through SSH that will sync the time from the PVR box to the clients:
    date -s"` (ssh root@hostname date "+%m%d%H%M")`"

    When I run that command it asks me to enter the password for the PVR box which is the default root password and then it alters the time on the old client apart from the year.

    So two questions, does anyone know how to change my command so that it also includes the year so that the time between the clients and PVR box is synced up.
    And is it possible to get the clients to run this command on startup so that when it tries to grab the EPG data from the PVR it's all correct?
    I did find the details on how to alter the autostart.sh script but I'm not sure to to get it to parse the password at the same time.

    Lot of questions there but I hope that someoen can help,

    Thanks

    Art


  • If the unraid box has no problem keeping the time you could run ntpd on it and use it as a local timeserver.

    Unraid has a timeserver built in but I've never been able to use it.
    I did find the ntp.conf file which has a line in it restricting the timeserver to not give the time to any client other than itself.
    I'd tried to comment it out but on restarting ntpd it goes back to how it was and then doesn't work hence trying the current method.
    [hr]


    Set up SSH keys and you won't need a password. Use "date --help" to see syntax.


    I think I've found the syntax to get the year working, just needed an extra %y at the start of the string, I'll try that tonight when I get home.

    Setting up SSH Keys, I'll have to do some reading on that, not a clue on it so that'll be new.

    Thanks for the pointers.

    Edited once, last by art-101 (June 29, 2016 at 1:26 PM).