Skip to content

Instantly share code, notes, and snippets.

@viniciusdaniel
Created May 17, 2013 21:16
Show Gist options
  • Save viniciusdaniel/5602018 to your computer and use it in GitHub Desktop.
Save viniciusdaniel/5602018 to your computer and use it in GitHub Desktop.
Exemplo de script de log rotate com script pos rotate
/omnilogic/retailcore/shared/log/*.log {
daily
missingok
rotate 0
compress
delaycompress
notifempty
copytruncate
sharedscripts
postrotate
if [ -d /mnt/omnibucket/retail_core_production/ ]; then
if [ "`ls -l /omnilogic/retailcore/shared/log/ | grep [.]gz | wc -l`" > "0" ]; then
BUCKET_PATH=/mnt/omnibucket/retail_core_production/log_rotate/`uname -n`/`date +"%Y%m%d%H%M%S"`;
mkdir -m 666 -p $BUCKET_PATH;
mv /omnilogic/retailcore/shared/log/*.gz $BUCKET_PATH;
fi
fi
endscript
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment