Tiny Core Base > TCB Tips & Tricks

set or sync time from your local dsl-router

(1/1)

halma:
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: ---date
Tue Sep 22 14:46:47 CEST 2020
--- End code ---

syncing the correct localtime:

--- Code: ---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

--- End code ---

after syncing command

--- Code: ---date
Tue Sep 22 16:49:12 CEST 2020
--- End code ---

Rich:
Hi halma
Very clever.

curaga:
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.

Navigation

[0] Message Index

Go to full version