9

I have several Rpi3s running Raspbian. They collect data and I use FileZilla to copy data from one to another. Ideally, I am only copying files that have changes or are new.

FileZilla can be installed on a PC at

FileZilla download (filezilla-project.org)

FileZilla can be installed in Raspbian with this command:

sudo apt-get update -y
sudo apt-get install FileZilla 

I have the options in FileZilla set to only overwrite existing files if they are newer. I also use chmod -w on my Archive directories on the target machines so only new files can be copied.

Yet FileZilla is spending way too much time copying files that are already there because the clocks on the Raspbians vary too much.

I want to set them all to a primary standard so they can agree better, thus minimizing the transfers of identical files.

According to the NIST page, the National Bureau of Standards suggests using time.nist.gov as the address that will reach a working system among all of the level 1 NTP servers available:

NIST Internet Time Servers

My question is in the title: How do I set Raspbian to use the primary time server time.nist.gov?

SDsolar
  • 2,378
  • 8
  • 26
  • 43

2 Answers2

8

Time server settings are saved in /etc/ntp.conf so open your favorite editor and make this change.

sudo nano /etc/ntp.conf

The relevant section looks like this:

enter image description here

So all you need to do is change it to look like this on all the relevant computers:

enter image description here

then reboot them.

Voila, the systems are now all using the NIST/NBS Master Clock to synchronize.

You can verify that it is working at Level 1 by using this command:

ntpq -p

Which gave me this output:

enter image description here

FileZilla is now running unbelievably faster as it is able to skip more files!

Amazing difference. Time synchronization is an excellent experience.

This is the best that can be attained via the Internet

time.nist.gov is a load-balancer that points to the best server for any particular location.


GPS gives better accuracy, but not as easy to set up.

Here is a Q&A about setting up a U-Blox 7 type G-Mouse USB GPS on the Pi:

How can I set up my G-Mouse USB GPS for use with Raspbian?

This article describes setting up the software for the GPS and to get it working. We'll still need someone to explain how to use it to create a local authoritative NTP server that all the other Linux machines can use as their reference in order to attain the best possible level of time synchronization with the Raspberry Pi 3B and Raspbian.

Notice how Google does it. The have GPS and atomic clocks at each data center all around the world:

GOOGLE SPANS ENTIRE PLANET WITH GPS-POWERED DATABASE (from Wired)


In Windows this same change is even easier. Just click on the clock and follow the prompts to change the Internet time to time.nist.gov then update.

By doing that, even transfers into and out of Windows (for hard drive backups) are a LOT faster as it skips files with the same creation date on both sides.

This has a pleasant side-effect of minimizing the amount of time it takes to ROBOCOPY out to a backup drive, too.

SDsolar
  • 2,378
  • 8
  • 26
  • 43
2

I have been fighting a problem with personally selected NTP sites since Raspbian Jessie. It seems that someone decided to force the setting of Debian pool servers into /etc/ntp.conf during each boot. Yesterday on this site, I found that the /etc/init.d/ntp script is the culprit. A simple edit of the file eliminates the pushing of the pool servers into ntp.conf. The script statements don't replace the whole file, but replace all servers you might have inserted, or replaced, so any other changes outside of the server definition area like GPS, PPS, etc. are untouched.

Simply edit /etc/ntp.conf, then find and comment out the lines shown below:

    # if [ -e /var/lib/ntp/ntp.conf.dhcp ]; then
    #     NTPD_OPTS="$NTPD_OPTS -c /var/lib/ntp/ntp.conf.dhcp"
    # fi

This will eliminate the changes at boot, and ntpd will use the /etc/ntp.conf as is.

Tom
  • 39
  • 6