on 06-04-2013 2:43 PM
Hi,
Few day back i asked a question regarding delete old log file(old .nmon files) .
I basically tried to come with a script which is perfect for my problem .
This is my script
#!/bin/sh
###
### Static variables
###
nmon_dir="/var/log/applog/nmon"
cd $nmon_dir
find $nmon_dir -xdev -type f -mtime +360 -name "*.nmon*" -exec rm {} \;
find $nmon_dir -xdev -type f -mtime +300 -name "*.nmon" -exec gzip {} \;
I could delete the files as i wanted but that I am not sure whether it compressed those file . Because I couldn't find .gz
file both in root
or /var/log/applog/nmon
path .
Need Help!
Hello
nmon_dir="/var/log/applog/nmon"
Modify the script like this:
nmon_dir=/var/log/applog/nmon
Good Luck
RB
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello
Do you see any files when you execute this :
find /var/log/applog/nmon -xdev -type f -mtime +300 -name "*.nmon" -exec ls -ltr {} \;
Regards
RB
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Reagan;
It doesn't list any files when give that command .
User | Count |
---|---|
80 | |
24 | |
11 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.