aboutsummaryrefslogtreecommitdiffstats
path: root/dcae-controller-core/dcae-controller-core-utils/src/main/server/bin/setup-logrotation.sh
diff options
context:
space:
mode:
authorlj1412 <lji@research.att.com>2017-02-14 15:12:08 +0000
committerlj1412 <lji@research.att.com>2017-02-14 15:12:10 +0000
commita84b847a3409df445482674feffa2872a8cbae83 (patch)
treea4f2dcaef92e0fb09402f2f28f793928d0a16bfd /dcae-controller-core/dcae-controller-core-utils/src/main/server/bin/setup-logrotation.sh
parente6bca17737d1897675e6403e196fc2a61f335651 (diff)
Init dcae.controller
Change-Id: I460f09494faa84b55d9c5d54112e098b0e74d007 Signed-off-by: lj1412 <lji@research.att.com>
Diffstat (limited to 'dcae-controller-core/dcae-controller-core-utils/src/main/server/bin/setup-logrotation.sh')
-rw-r--r--dcae-controller-core/dcae-controller-core-utils/src/main/server/bin/setup-logrotation.sh28
1 files changed, 28 insertions, 0 deletions
diff --git a/dcae-controller-core/dcae-controller-core-utils/src/main/server/bin/setup-logrotation.sh b/dcae-controller-core/dcae-controller-core-utils/src/main/server/bin/setup-logrotation.sh
new file mode 100644
index 0000000..aff11b1
--- /dev/null
+++ b/dcae-controller-core/dcae-controller-core-utils/src/main/server/bin/setup-logrotation.sh
@@ -0,0 +1,28 @@
+#!/bin/bash
+
+APP=$1
+
+LOG1=$(echo $APP | sed s/dcae-//).err
+LOG2=$(echo $APP | sed s/dcae-//).out
+
+cat > | /etc/logrotate.d/$APP << EOF
+
+/opt/app/$APP/logs/$LOG1 {
+ missingok
+ compress
+ daily
+ rotate 14
+ dateext
+ copytruncate
+}
+
+/opt/app/$APP/logs/$LOG2 {
+ missingok
+ compress
+ daily
+ rotate 14
+ dateext
+ copytruncate
+}
+
+EOF \ No newline at end of file