10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hi,
i wants to create the script for my linux server.
my system log files are getting huge frequently /root file system getting filled frequently.so wants to delete the logs when it crossed 1GB data on it.
Please help me how do i create the bash script..
i use solaris 10 OS... (3 Replies)
Discussion started by: Rahulne25
3 Replies
2. Shell Programming and Scripting
i am using HP-UX OS......
delete logs older than 60 days
find -mtime +60 | grep -i '.*log' | xargs rm
-mtime is nt available in HP-UX, pls tell me other option ? (2 Replies)
Discussion started by: only4satish
2 Replies
3. Shell Programming and Scripting
Hi All,
I have a requirement to fetch logs of last 'N' days.
I am trying the following command which is working fine if it finds the date of that day in logfile.
START=`TZ="GMT+$((24*N))" date +"%Y %b %d"`
this is being used to fetch 'N'th day's date
and
awk '/'"$START"'/{p=1}... (24 Replies)
Discussion started by: KDMishra
24 Replies
4. Shell Programming and Scripting
I want to write a shell script that deletes all log files in a directory that are older than 30 days except for 3 files:
I am using the following command:
find /tmp/logs -name "*.log" -mtime +30 -exec rm -f {} \;But this command deletes all the log files.
How can i modify this script that... (5 Replies)
Discussion started by: mmunir
5 Replies
5. Shell Programming and Scripting
All,
How to remove the logs that are more than 5 days old from a particular folder.
Help will be highly appreciated.
Regards
Oracle User (2 Replies)
Discussion started by: Oracle_User
2 Replies
6. UNIX for Dummies Questions & Answers
Hi
Can u please tell me how to delete last 10 days logs .. (9 Replies)
Discussion started by: pb18798
9 Replies
7. UNIX for Advanced & Expert Users
My code is
tar -cvf logs.tar `find /usr/openv/logs/512*.log -mtime +2` && find *.log* -mtime +2 -exec rm {} \;
this gives me output as:
tar: Missing filenames:confused: (1 Reply)
Discussion started by: timus1980
1 Replies
8. Shell Programming and Scripting
Hi,
I would like to list latest 2 days, 3 days or 4 days,etc of files in the directory...
how? is it using ls? (3 Replies)
Discussion started by: happyv
3 Replies
9. UNIX for Dummies Questions & Answers
Hi,
I must confess i have a very basic knowledge of UNIX and its commands, but i was hoping someone would be able to help answer my query.
Once a month as part of a team we have to perform housekeeping on our UNIX directories, we remove certain files older than 30 days and compress the... (3 Replies)
Discussion started by: swellybro
3 Replies
10. Shell Programming and Scripting
Simple question I am sure - but one that I dont know the answer to nevertheless..
I have a directory that I store log files in - but I wish to run a daily script in cron to delete all files in this directory that have not been modified within the last 7 days...
Can anyone help me? (10 Replies)
Discussion started by: frustrated1
10 Replies