title: Bash script log file rotation
body: <p>My bash script produces a log file. Now i'd like to implement some log file rotation.<br> Let's say the first time it's called <strong>somelog.log</strong>, the next time it's renamed to <strong>somelog.log.1</strong> and the new log file <strong>somelog.log</strong>.<br>The third time the new log is <strong>somelog.log</strong> again, but <strong>somelog.log.1</strong> is renamed to <strong>somelog.log.2</strong> and the old <strong>somelog.log</strong> to <strong>somelog.log.1</strong>.<br>I would be able to grant a maximum of eg 5.<br><br> Is this done before (sample script), any suggestions. I appreciate any advice.</p>