Sponsored Content
Operating Systems Linux Using logrotate to trim files that are created every 15 mins Post 302439335 by aussieos on Thursday 22nd of July 2010 09:21:09 AM
Old 07-22-2010
Using logrotate to trim files that are created every 15 mins

I have an application (puppet) that generates report files every 15 minutes in the format:
/var/lib/puppet/reports/hostname.fqdn/report-201007221515.yaml
/var/lib/puppet/reports/hostname.fqdn/report-201007221530.yaml
..

I only really need to keep one days worth of these reports and am trying to use logrotate to keep it to that:
Code:
/var/lib/puppet/reports/*/* {
  missingok
  maxage 2
  rotate 0
  daily
}

However it's now 22nd July but when I run logrotate I get messages like:
Code:
considering log /var/lib/puppet/reports/virtase3.fqdn/201007201358.yaml   
  log does not need rotating

Showing it's not seeing log files from 2 days ago as needing removal.

Any suggestions of what to add to my logrotate config?
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

files created within last 10 mins

Any simple 1 liners to check a directory to see if a file was created within the last 10 mins? (5 Replies)
Discussion started by: frustrated1
5 Replies

2. Shell Programming and Scripting

Finding files which are modified few mins ago

Hi All, I have a requirement to find out the files which are modified in the last 10 minutes. I tried the find command with -amin and -mmin options, but its not working on my AIX server. Can anyone of you could help me. Thanks in advance for your help. Raju (3 Replies)
Discussion started by: rajus19
3 Replies

3. UNIX for Dummies Questions & Answers

how to find the modified files before 60 mins?

hi, I need to find all the modified files before 60 minutes in a folder. Is that possible to find using mtime in minutes? Suggestions please. Thanks for looking into it... Geetha (8 Replies)
Discussion started by: iamgeethuj
8 Replies

4. UNIX for Advanced & Expert Users

logrotate with /etc/logrotate.conf file

Hi there, I want to rotate the logfiles which are located in /var/log/jboss/tomcat* so I have created a file named as 'tomat' in /etc/logrotate.d/tomcat with the following content. # cat /etc/logrotate.d/tomcat /var/log/jboss/tomcat_access_log*.log { daily nocreate ... (2 Replies)
Discussion started by: skmdu
2 Replies

5. UNIX for Advanced & Expert Users

how to logrotate log files

Hi, I have written a script that runs every five minutes in cron schedular. The Operating system is Fedora core 9. This script generates 2 log files, these log file size is increasing as some log data is being dumped into these 2 log files every five minutes. I need to logrotate these 2 files.... (1 Reply)
Discussion started by: renuka
1 Replies

6. Red Hat

Logrotate not removing old files

Hi Guys, Need some help with the logrotate for one of our servers. I had setup a logrotation so that all files that go under old/ folder should be removed after one week. The log files are rotated daily from the main folder to old/ folder. (everything on one server) Below is the sample I am... (0 Replies)
Discussion started by: rockf1bull
0 Replies

7. Shell Programming and Scripting

Logrotate - I am not able to rotate files using logrotate

I have written script which is working in Home directory perfectly and also compressing log files and rotating correctly. But, when i try to run script for /var/log/ i am able to get compressed log files but not able to get rotation of compressed log files. Please suggest. I am using below command... (5 Replies)
Discussion started by: VSom007
5 Replies

8. AIX

Logrotate - /etc/logrotate.conf does't exist

Hi Admins. I have installed logrotate rpm on Aix 6.1. After the installation of rpm, I don't find /etc/logrotate.conf file and /etc/logrotate.d dir . The config file is located in /opt/freeware/etc/logrotate.conf. When I ran logrotate -v /opt/freeware/etc/logrotate.conf I get below... (2 Replies)
Discussion started by: snchaudhari2
2 Replies

9. Shell Programming and Scripting

How to select all files added to a directory in the past 5 mins (HP-UX)?

Hey everyone, I need to select all files that were added to a specific directory in the past 5 mins and copy them over to a different directory. I am using HP-UX OS which does not have support for amin, cmin, and mmin. B/c of this, I am creating a temp file and will use the find -newer command... (7 Replies)
Discussion started by: mattkoz
7 Replies

10. UNIX for Beginners Questions & Answers

Logrotate and Compressing only yesterdays files

Hello, I have a syslog server at home and am currently experiencing an issue where my logs will rotate and compress however it will rotate and compress yesterdays file and the newly created log file for the current day. When it does this however it will also create another new file for today... (9 Replies)
Discussion started by: MyUserName7000
9 Replies
PUPPET-DEVICE(8)						   Puppet manual						  PUPPET-DEVICE(8)

NAME
puppet-device - Manage remote network devices SYNOPSIS
Retrieves all configurations from the puppet master and apply them to the remote devices configured in /etc/puppet/device.conf. Currently must be run out periodically, using cron or something similar. USAGE
puppet device [-d|--debug] [--detailed-exitcodes] [-V|--version] [-h|--help] [-l|--logdest syslog|<file>|console] [-v|--verbose] [-w|--waitforcert <seconds>] DESCRIPTION
Once the client has a signed certificate for a given remote device, it will retrieve its configuration and apply it. USAGE NOTES
One need a /etc/puppet/device.conf file with the following content: [remote.device.fqdn] type type url url where: * type: the current device type (the only value at this time is cisco) * url: an url allowing to connect to the device Supported url must conforms to: scheme://user:password@hostname/?query with: * scheme: either ssh or telnet * user: username, can be omitted depending on the switch/router configuration * password: the connec- tion password * query: this is device specific. Cisco devices supports an enable parameter whose value would be the enable password. OPTIONS
Note that any configuration parameter that's valid in the configuration file is also a valid long argument. For example, 'server' is a valid configuration parameter, so you can specify '--server servername' as an argument. --debug Enable full debugging. --detailed-exitcodes Provide transaction information via exit codes. If this is enabled, an exit code of '2' means there were changes, an exit code of '4' means there were failures during the transaction, and an exit code of '6' means there were both changes and failures. --help Print this help message --logdest Where to send messages. Choose between syslog, the console, and a log file. Defaults to sending messages to syslog, or the console if debugging or verbosity is enabled. --verbose Turn on verbose reporting. --waitforcert This option only matters for daemons that do not yet have certificates and it is enabled by default, with a value of 120 (seconds). This causes +puppet agent+ to connect to the server every 2 minutes and ask it to sign a certificate request. This is useful for the initial setup of a puppet client. You can turn off waiting for certificates by specifying a time of 0. EXAMPLE
$ puppet device --server puppet.domain.com AUTHOR
Brice Figureau COPYRIGHT
Copyright (c) 2011 Puppet Labs, LLC Licensed under the Apache 2.0 License Puppet Labs, LLC June 2012 PUPPET-DEVICE(8)
All times are GMT -4. The time now is 09:00 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy