aureport命令中ts及te的正确使用方法
/*********************************************************************
Author : Samson
Date : 12/27/2021
Test platform:
Debian 10
*******************************************************************/
原文链接:https://blog.csdn.net/yygydjkthh/article/details/122164005
在使用aureport命令时,使用-ts及-te参数时,使用日期参数时总是不对的问题, 如下:
# aureport -l --failed -ts 08/08/2021
Error parsing start date (08/08/2021)
usage: aureport [options]
......
# aureport -l --failed -te 08/08/2021
Error parsing end date (08/08/2021)
usage: aureport [options]
......
在man aureport中有这么一句说明:
The date format accepted is influenced by the LC_TIME environmental variable.
意思是ts或te后的时期或时间格式必须是和本地的日期或时间的格式一致.
通用man date命令可看到,%x是本地日期的表示法,%X是本地时间的表示法,即在使用aureport中使用ts或te时,必须和这个格式一致.