Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Script para Limpeza de Logs OSX
#! /bin/sh
#
echo Script Escrito para Limpeza de Logs MacOs
echo By Clandestine
echo @clandestine4
echo 'Use por sua conta e risco'
echo zerando os arquivos de logs
rm -rf /private/var/log/*
rm -rf /Library/Logs/*
rm -rf /private/var/tmp/*
rm -rf /System/Library/Caches/*
rm -rf /private/tmp/*
rm -rf /private/var/tmp/*
function ProgressBar {
# Process data
let _progress=(${1}*100/${2}*100)/100
let _done=(${_progress}*4)/10
let _left=40-$_done
# Build progressbar string lengths
_fill=$(printf "%${_done}s")
_empty=$(printf "%${_left}s")
# 1.2 Build progressbar strings and print the ProgressBar line
# 1.2.1 Output example:
# 1.2.1.1 Progress : [########################################] 100%
printf "\rProgress : [${_fill// /#}${_empty// /-}] ${_progress}%%"
}
# Variables
_start=1
# This accounts as the "totalState" variable for the ProgressBar function
_end=100
# Proof of concept
for number in $(seq ${_start} ${_end})
do
sleep 0.1
ProgressBar ${number} ${_end}
done
printf '\nFinished!\n'
clone this paste
@clandestine4

This comment has been minimized.

Copy link
Owner Author

clandestine4 commented Mar 25, 2015

Script Simples para Limpeza de Logs em Ambientes OSX

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.