Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

Set time with bash over ssh

  • 24-06-2010 03:59PM
    #1
    Registered Users, Registered Users 2 Posts: 3,745 ✭✭✭


    Some servers don't have access to ntp server, any downsides to setting the time like this regularly?
    cat  server_list.parm | while read server; do
    TIME=`date | awk '{print $4}'`
    CMD="date +%T -s "$TIME""
    ssh -n [EMAIL="root@$server"]root@$server[/EMAIL] "$CMD"
    done
    


Comments

  • Registered Users, Registered Users 2 Posts: 37,485 ✭✭✭✭Khannie


    Well....The time taken to exchange keys etc. would skew things.

    I'm sure it would be fine 99% of the time.


  • Closed Accounts Posts: 4,564 ✭✭✭Naikon


    Why not setup one of the machines that do have net access to act as an NTP server? Assuming the other machines can access this box locally, job done.
    It's always best to use NTP unless you have no other means.


Advertisement