Reputation: 189
I'm trying to code a bash script that set Time and Date manually, this work but after reboot my system (Ubuntu 18.04) time and date resets to automatic mode. How I can write a bash for set time/date that not change after reboot?
My try as a beginner ended to this Bash script:
#!/bin/bash
# A simple bash script to set system date & time
timedatectl set-ntp 0
date +%Y%m%d -s $1
date +%T -s $2":00"
Upvotes: 0
Views: 3295
Reputation: 1490
timedatectl set-ntp 0 && timedatectl set-time 'HH:MM:SS'
will turn off web clock sync and let you update it manually.
Upvotes: 2