update-time.sh 356 Bytes
Newer Older
Jean-Francois Rey's avatar
Jean-Francois Rey committed
1
2
3
4
5
6
7
8
9
10
#/bin/bash

echo "Time synchronization forcing..."
sudo touch /var/db/ntp-kod
sudo chmod 666 /var/db/ntp-kod

# force time update
sudo sntp -sS pool.ntp.org

# force time cron 1m
Jean-Francois Rey's avatar
Jean-Francois Rey committed
11
(sudo crontab -l 2>/dev/null;  echo "*/1 * * * * sntp -sS pool.ntp.org") | sudo crontab -
Jean-Francois Rey's avatar
Jean-Francois Rey committed
12
13

# never know...
Jean-Francois Rey's avatar
Jean-Francois Rey committed
14
#sudo echo "server pool.ntp.org minpoll 4 maxpoll 5" > /etc/ntp.conf
Jean-Francois Rey's avatar
Jean-Francois Rey committed
15