Portál AbcLinuxu, 15. července 2025 23:14
#!/bin/bash # ## Stiahne z internetu UTC cas a ulozi vysledok do suboru # export SUBOR=/etc/utc_time /usr/bin/telnet 131.107.1.10 13 | /bin/grep UTC | /bin/cut -d\ -f2,3 > $SUBORTento script funguje z promptu. To znamena, ze vystup z prikazu telnet je
~ # telnet 131.107.1.10 13 Trying 131.107.1.10... Connected to time-nw.nist.gov (131.107.1.10). Escape character is '^]'. 53037 04-02-02 07:56:19 00 0 0 879.8 UTC(NIST) * Connection closed by foreign host. ~ #Ale nefunguje ked to zapisem do crontabu /etc/cron.d/utc_time :
*/2 * * * * root /usr/local/dfinetserv/bin/get_utc_time.shV takomto pripade to telnet iba vypise:
Trying 131.107.1.10... Connected to time-nw.nist.gov (131.107.1.10). Escape character is '^]'.Nemozem sa dopracovat k zaslanemu casu, ak to spustam cez cron. Googlovanie mi moc nepomohlo - http://www.netsys.com/sunmgr/2001-10/msg00317.html
Tiskni
Sdílej:
ISSN 1214-1267, (c) 1999-2007 Stickfish s.r.o.