• 🏠 Accueil
  • 🧰 Générateurs
  • 📰 Blog
  • 🔎 Rechercher
  • 📧 Contact
  • 📘 Livre d'or
  • 🗞️ News
  • 💰 Soutien
  • Description

    This script uses ntpdate command, to update system date/time, using ntp.ubuntu.com reference time. ntp_update.sh

    ntp_update.sh

    #!/bin/bash 
    #################################### 
    # Script: ntp_update.sh            # 
    # Author: Jerome DESMOULINS        # 
    # Version: 1.00                    # 
    # Last Update: 2010/08/13          # 
    #################################### 
    # Description:                     # 
    #   This script update system time # 
    #   It connects to ntp.ubuntu.com  # 
    #################################### 
    
    ### Initialisation for environnement variables mandatory for DjeShellSteps ### 
    . `dirname $0`/djeshellsteps.sh 
    
    ### Beginning of Shell Script ### 
    BeginSteps 
    echo "Starting Shell Script..." 
    
    ###################################################### 
    Step 10 "Updating server time from Ubuntu NTP server" 
    ###################################################### 
    if [ $RunThisStep -eq 1 ]; then 
      /usr/sbin/ntpdate ntp.ubuntu.com 
    fi 
    
    ### End of Shell Script ### 
    EndSteps 

    Retour



    (c) 2005-2025 Jérôme DESMOULINS
    Mentions légales