I have a Linux machine that only has very minimal cmds available on it, for example the /bin
looks like this:
/bin# ls
ash chattr clockdiff dd dumpkmap fdflush gunzip linux32 ls mktemp mt pidof printenv rmdir setserial su tracepath umount watch
busybox chgrp cp df echo fgrep gzip linux64 lsattr more mv ping ps run-parts sh sync tracepath6 uname zcat
cat chmod cpio dmesg egrep getopt hostname ln mkdir mount netstat ping6 pwd sed sleep tar traceroute6 usleep
catv chown date dnsdomainname false grep kill login mknod mountpoint nice pipe_progress rm setarch stty touch true vi
Also, it doesn't have /usr/share/zoneinfo
dir.
So how can I set a time zone on it with these cmds? I also need to sync the time zone and date on it remotely from another host.
I tried TZ
env variable, but it doesn't work, e.g:
root@xxx:/bin# date
Wed Aug 31 12:02:41 UTC 2023
root@xxx:/bin# TZ=America/New_York date
Thu Aug 31 12:03:50 America 2023
root@xxx:/bin# date
Thu Aug 31 12:04:58 UTC 2023
Notice that the time doesn't change when TZ is set.