Rotiranje logova (primjer)
#!/bin/sh
# Ime log datoteka koje rotirate:
file=’gopher’
# Direktorij u kojem se logovi nalaze:
directory=‘/var/log’
cd “$directory” || exit 1
# Koliko starih logova cuvate:
j=7
for i in 6 5 4 3 2 1 0; do
if [ -f “$file.$i.Z” ]; then
/bin/mv -f “$file.$i.Z” “$file.$j.Z”
fi
j=$i
done
?
Previous slide
Next slide
Back to first slide
View graphic version