1

my idea is to collect logs each 24 hours ,mail it and flush them after that

i wrote some scatch for example 1.var/log/auth

{some info} 2.var/log/something.log {some info}

list="$(find /var/log -name *.log )"
for file in $list;do
echo  '#############################'
onehourago=$(date --date='1 hours ago' +"%b%e %H:%M:%S")
echo $onehourago | cat $file - |sort| sed "1,/$onehourago/d"
done

but still could not understand the problem

closed as unclear what you're asking by Fabby, Rui F Ribeiro, Sparhawk, G-Man, Stephen Harris Jan 19 at 3:37

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • 2
    What’s your question? – Peschke Jan 18 at 22:37
  • i cant make a proper list as i want it just a big list without delimeter – staz Jan 18 at 22:39
0

Why aren't you using [logrotate]?1 It even has an option to mail the log to you.

Not the answer you're looking for? Browse other questions tagged or ask your own question.