#!/bin/bash # weekly truncate the below files to a 100 lines function trunc() { echo "$(tail -1000 ${1})" > ${1} } trunc /tmp/monitor_emails.log trunc /tmp/sms.log trunc /tmp/meteoo.err trunc /tmp/monitor.err