Rotating the Log Files

 The simplest is likely to start the coupler from a shell script that has the log rotate in front of it.  That way each time it is started it will remove old logs.  I found the below in the internet.


1

I agree that parsing ls is evil!

Ensure only the last 5 files are kept in the /srv/backups path.

find /srv/backups -maxdepth 1 -type f -printf '%Ts\t%P\n' \
    | sort -rn \
    | tail -n +6 \
    | cut -f2- \
    | xargs -r r
  improve this answer   
  • This is the best solution here simply because it doesn't parse the output of ls. (It does have a problem if you have newlines in your filenames though, eek!) – bobbogo Feb 6 at 16:03

and also:

find /Users/test/delete/*.zip -mtime +10 -exec rm {} \;

Comments

Popular Posts