10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
As i am working in unix environment so i have an logs that is created by my application at the following location that is
/opt/app/glac/current/servers/ops/logs
inside the logs directory there are different kinds of logs(that is the file having extension as .log ) have been created... (1 Reply)
Discussion started by: 2015nks
1 Replies
2. Shell Programming and Scripting
Will this work to delete files 30 days old in $backupDir or is there a better way to do it?
find $backupDir -type f -mtime +30 -exec rm {} \; (2 Replies)
Discussion started by: wyclef
2 Replies
3. 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
4. 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
5. 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
6. 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
7. Shell Programming and Scripting
Hi..
Am using diff to compare 2 directories(A & B) and as ouput i get a list of files which are found only in directory B ( I used grep & sed to create the list).
Now I want to delete the files which are found only in dir B after 3 days.
Please help me with this.
Thanks
CoolAtt (7 Replies)
Discussion started by: coolatt
7 Replies
8. 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
9. Shell Programming and Scripting
Hello All,
We have a directory where we have old archived logs. They are numbered <logfile>.log.1 till <logfile>.log.100 or more. I just want to keep 10 log files and delete others through the script.
Please advise.
Thanks,
Chiru (4 Replies)
Discussion started by: chiru_h
4 Replies
10. UNIX for Dummies Questions & Answers
I have a directory that contains files. I would like the command that deletes all files that are over 30 days old. Delete files based on creation date and not modified. (2 Replies)
Discussion started by: GEBRAUN
2 Replies