custom_log_rotate_script
Differences
This shows you the differences between two versions of the page.
| custom_log_rotate_script [2009/06/04 15:01] – created k2patel | custom_log_rotate_script [Unknown date] (current) – removed - external edit (Unknown date) 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ==== Custom Log rotate script ==== | ||
| - | |||
| - | <code bash | custlogrotate.sh> | ||
| - | #!/bin/sh | ||
| - | |||
| - | yesterday=`date -v-1d ' | ||
| - | |||
| - | mkdir / | ||
| - | |||
| - | for i in `ls /home/log | grep $yesterday` | ||
| - | do | ||
| - | echo $i | ||
| - | mv $i / | ||
| - | done | ||
| - | |||
| - | tar -cvf / | ||
| - | rm -rf / | ||
| - | chown -R user:group /home/log | ||
| - | </ | ||
custom_log_rotate_script.1244127675.txt.gz · Last modified: 2020/08/10 02:29 (external edit)
