mirror of
https://github.com/rwinkhart/artix-install-script.git
synced 2026-10-27 03:19:56 -04:00
Only sync ntp once per week, sync to hardware clock
This commit is contained in:
1 parent
60d94900d7
commit
0b4ba9560a
3 files changed
+10
-3
No files matched your search
@@ -0,0 +1,8 @@
|
||||
#!/bin/sh
|
||||
old_timestamp="$(</etc/local.d/.ntpsync)"
|
||||
new_timestamp="$(date +%s)"
|
||||
if [ "$((new_timestamp-old_timestamp))" -gt 604800 ]; then
|
||||
ntpdate -b pool.ntp.org
|
||||
hwclock --systohc --utc
|
||||
echo "$new_timestamp" > /etc/local.d/.ntpsync
|
||||
fi
|
||||
Reference in new issue
Block a user