Automatic time update
If you have a server that day and night to run if you do not always check that your system still displays the correct time. With the script you can set each day your server is the system clock update.
This tweak is applied to any Linux distribution, using cronjobs.
First we make a small file with your favorite text editor and type the following text:
Code:And stores it in eg / usr / local / bin as update_#! / bin / sh
ntpdate pool.ntp.org
time.
This file must then be made executable:
Code:$ chmod + x update_
time
Then go to / etc and open the crontab file (must be root / super user).
As you add the following line under # run-parts:
Code:# Run-parts
0 4 * * * root / usr / local / bin / update_time
This file in turn.
The five positions (0 4 * * *) for 'root' to where you want the script is executed:
Code:In other words, this code ensures that every night at 04:00 pm the script to the location / usr / local / bin / update_0 / / The 1st position indicates the minute of the time the script is executed
4 / / The second digit indicates the hour (ie at 4 am)
* / / The third on the day of the month (* = any day of the month)
* / / The fourth which month (* = any day of the month)
* / / The fifth position indicates the day of the week (* = any day of the week)
time is executed by user root. If you are sure that your server every day at the time
Bookmarks