Skip to main content

Posts

Showing posts from October, 2024

Check Chrony logs on.Linux

Chrony service maintains synchronizing with external time sources like NTP servers. In Redhat, Rocky or Alma Linux, Chrony logs can be checked using journalctl. Example: sudo journalctl -u chronyd -xe The output will be limited only to the.log or entries of Chronyd service. To check status of Chronyd, use systemctl status chronyd To further check any log entries pertaining to chronyd, browse to /var/log cd /var/log And type: egrep "*chrony*" . This will check all log entries that has the string chrony, include the dot at the end to check all files on the current path. You can examine those files.if need to troubleshoot further, or just view the configuration of Chrony for any misconfiguration such as typo error, or unsupported Chrony settings. To view the chrony configuration,.type: grep ^[^#] /etc/chrony.conf This will view only the configuration that are currently enabled or uncommented lines, and also remove any blank lines. chronyc sources -v  The above command will show

Linux clear logs or big files

To easily clear a log file or empty a big file. Type this on a terminal,.make sure to zip or backup the file if you feel you might need it later. > MyBigLog_file.txt Yes, just type greater than sign,.followed by the filename of a log file or any file. Don't do this in Production if not sure of the consequences. If the file exists it will empty the file, if the file doesn't exist it will create the file. Test it on a VM, to see what it really does before rolling out to production. Cheers,. enjoy Linux and command line. Be still and know God is in control!