cron - Compress log file in a shell script -
cron - Compress log file in a shell script -
i have application deployed in jboss 7.1. need compress rotated files in gz format. thinking of create shell script in order that.
any thought how?
shell script sounds good. basically, if want rotate files older x an
find -mtime $time -exec mv "{}" "$tmp_dir/" {}\;
compress files in $tmp_dir, remove $tmp_dir, maintain archive. :)
when rotate script called next time can list created archives sorted creation info , remove oldest 1 if more n .gz archives exist
shell cron gzip jboss7.x
Comments
Post a Comment