Skip to content

Instantly share code, notes, and snippets.

@douglascrp
Last active November 1, 2018 13:15
Show Gist options
  • Save douglascrp/788783aa026aeccb9dfee22642f17e8f to your computer and use it in GitHub Desktop.
Save douglascrp/788783aa026aeccb9dfee22642f17e8f to your computer and use it in GitHub Desktop.
chattr +i /mountpoint (with the mount unmounted)
du -h -d 1 | sort -rh | head -5
# Remove arquivos de log com mais de 7 dias
find /opt/alfresco/logs/* -maxdepth 0 -name '*.log*' -mtime +7 -type f -exec rm {} \;
find /opt/alfresco/logs/bart/* -maxdepth 0 -name '*.log*' -mtime +7 -type f -exec rm {} \;
find /opt/alfresco/tomcat/logs/* -maxdepth 0 -name '*.log*' -mtime +7 -type f -exec rm {} \;
**Para uma varianção usando o diretório "atual" como parâmetro para o find:**
cd /opt/alfresco/logs
find `pwd`/* -maxdepth 0 -name '*.log*' -mtime +7 -type f -exec rm {} \;
cd /opt/alfresco/logs/bart
find `pwd`/* -maxdepth 0 -name '*.log*' -mtime +7 -type f -exec rm {} \;
cd /opt/alfresco/tomcat/logs
find `pwd`/* -maxdepth 0 -name '*.log*' -mtime +7 -type f -exec rm {} \;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment