We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent aeef397 commit 57b6d3eCopy full SHA for 57b6d3e
crontab
@@ -1,3 +1,3 @@
1
# Run logrotate.sh daily at midnight
2
-0 0 * * * /app/logrotate.sh >> /var/log/cron.log 2>&1
3
-0 0 * * * echo "Hello World! I am working!" >> /var/log/cron.log 2>&1
+0 * * * * /app/logrotate.sh >> /var/log/cron.log 2>&1
+0 * * * * echo "Hello World! I am working!" >> /var/log/cron.log 2>&1
logrotate.sh
@@ -2,11 +2,11 @@
echo "Running logrotate"
4
5
-# Create a temporary logrotate configuration file
+# Create a temporary logrotate configuration file that rotates hourly and keeps 168 ( 7 days ) rotated logs
6
cat <<EOF > /tmp/logrotate.conf
7
"$LOG_PATH" {
8
- daily
9
- rotate 31
+ hourly
+ rotate 168
10
compress
11
delaycompress
12
postrotate
0 commit comments