Tiny Core Linux

Tiny Core Base => TCB Tips & Tricks => Topic started by: halma on September 22, 2020, 07:55:28 AM

Title: set or sync time from your local dsl-router
Post by: halma on September 22, 2020, 07:55:28 AM
Hi,

if you wanna set or sync the correct localtime on tinycorelinux from command line without additional packages you can use this command:

my date before syncing from my dsl-router
Code: [Select]
date
Tue Sep 22 14:46:47 CEST 2020

syncing the correct localtime:
Code: [Select]
sudo busybox date -s "$(wget -qSO- INSERT-YOUR-DSL-ROUTER-IP-HERE 2>&1 | grep '^  Date:' | cut -d' ' -f 5-)" -D "%d %b %Y %T %Z"
Tue Sep 22 16:49:10 CEST 2020

after syncing command
Code: [Select]
date
Tue Sep 22 16:49:12 CEST 2020
Title: Re: set or sync time from your local dsl-router
Post by: Rich on September 22, 2020, 11:50:21 AM
Hi halma
Very clever.
Title: Re: set or sync time from your local dsl-router
Post by: curaga on September 23, 2020, 01:50:00 AM
This was just recently discussed on the bb ml. Busybox httpd (by default) does not send that header, so if your router uses busybox, you may have to wget another site.