collect logs from bash each 24 hours [closed]
Clash Royale CLAN TAG#URR8PPP
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
bash sed date sort
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.
add a comment |
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
bash sed date sort
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
add a comment |
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
bash sed date sort
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
bash sed date sort
bash sed date sort
edited Jan 18 at 23:26
Rui F Ribeiro
39.9k1479134
39.9k1479134
asked Jan 18 at 22:34
stazstaz
62
62
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.
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
add a comment |
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
2
2
What’s your question?
– Peschke
Jan 18 at 22:37
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
i cant make a proper list as i want it just a big list without delimeter
– staz
Jan 18 at 22:39
add a comment |
1 Answer
1
active
oldest
votes
Why aren't you using [logrotate]?1 It even has an option to mail the log to you.
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Why aren't you using [logrotate]?1 It even has an option to mail the log to you.
add a comment |
Why aren't you using [logrotate]?1 It even has an option to mail the log to you.
add a comment |
Why aren't you using [logrotate]?1 It even has an option to mail the log to you.
Why aren't you using [logrotate]?1 It even has an option to mail the log to you.
answered Jan 18 at 23:56
GarnetGarnet
263
263
add a comment |
add a comment |
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