Bash Datestamps

        Format/result         |       Command              |          Output ——————————+—————————-+—————————— YY-MM-DD_hh:mm:ss             | date +%F_%T                | $(date +%F_%T) YYMMDD_hhmmss                 | date +%Y%m%d_%H%M%S        | $(date +%Y%m%d_%H%M%S) YYMMDD_hhmmss (UTC version)   | date –utc +%Y%m%d_%H%M%SZ | $(date –utc +%Y%m%d_%H%M%SZ) YYMMDD_hhmmss (with local TZ) | date +%Y%m%d_%H%M%S%Z      | $(date +%Y%m%d_%H%M%S%Z) YYMMDDhhmmss                  | date +%Y%m%d%H%M%S         | $(date +%Y%m%d%H%M%S) YYMMDDhhmmssnnnnnnnnn         | date +%Y%m%d%H%M%S%N       | $(date…

CategoriesUncategorized

Set machine to a timezone

Simple and easy : ln -sf /usr/share/zoneinfo/UTC /etc/localtime nJoy 😉

CategoriesUncategorized

Enable VMWare time sync from command line

Virtual machines and NTP do not go easily well together. Machines paused for extended periods tend to loose the ntp sync since the difference grows too much.   Also from VMware Docs the following info might be clarificatory: Do not configure the virtual machine to synchronize to its own (virtual) hardware clock, not even as…

CategoriesUncategorized

Setting up NTP server

Setting up NTP is very important for a host of application especially clusters and applications like DBs requiring all the servers to be critically time-wise synced. Install NTP on Red Hat and CentOS 6 $ yum install ntp $ chkconfig ntpd on $ ntpdate pool.ntp.org $ service ntpd start Install NTP on Ubuntu $ apt-get…

CategoriesUncategorized