Sponsored Content
Top Forums Shell Programming and Scripting Deleting dated log files whihc are older than an year Post 302958141 by nanz143 on Tuesday 20th of October 2015 12:56:58 AM
Old 10-20-2015
Hi Don,

Please ignore that. i have renamed the original files for few reasons and i think i missed to rename these sorry for that confusion.

regarding
Code:
find . -name 'Ft*.*.log' -mtime +364 -exec echo rm {} +

this will remove all the logs more than 364 days, including the the ones in sub directories which is not expected.

I will try with the ksh script you gave and get back to you.. Thanks much!!
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Deleting files older than a given date

Hi all, I want to delete all files in a directory which are older than a given date. I thought of doing it by creating a file by the required date by using touch command. And then i would use find command on that file and try to find files older than that. I searched the man and found a... (3 Replies)
Discussion started by: rajugp1
3 Replies

2. Solaris

Deleting Files Older than 24 hours

Hi, I am using Solaris Box, I need to delete file(cookies.html) from the path(/usr/temp) which are older than 24 hours(I want in hours, not in days) Can u provide the command for the above query (7 Replies)
Discussion started by: mazhar803
7 Replies

3. Shell Programming and Scripting

Deleting files older than 7 days

Hi Guys, I want to delete folder/files older than 7 days. Im using the command below. find /test/test1 -mtime +7 -print0 | xargs -0 rm -Rf /test/test1/* which works ok, but it deletes the test1 folder as well which i dont want. The test1 folder will have a list of sub-folders which in... (4 Replies)
Discussion started by: shezam
4 Replies

4. UNIX for Dummies Questions & Answers

Deleting specfic files older than N days

Hello, I am trying to delete specific files older than 7 days that start with FSTRnnnn (nnnn=sequnce number) from /home/users/userdir I.E cd home/users/userdir ll FSTR0001 Jul 8 14:20 FSTR0002 Jul 6 12:01 FSTR0003 May 25 09:45 FSTR0004 April 2 17:20 MSTR0034 Jul 6 12:45... (3 Replies)
Discussion started by: eurouno
3 Replies

5. UNIX for Advanced & Expert Users

Deleting older files of a particular type

hi This should be easy but i'm obviously missing something obvious. :) I'm looking to delete files from yesterday and older of extension .txt and there a range of subfolders with these files in them. The command runs but doesn't delete anything. SUSE 10. find /testfolder -maxdepth 2 -type f... (6 Replies)
Discussion started by: cmap
6 Replies

6. Shell Programming and Scripting

deleting files older than 7 days

Hi Guys, I am new to unix I am looking for a script to delete files older than 7 days but i also want to exclude certain directories (like arch,log .....) and also some files with extensions ( like .ksh, .ch, ..............) Thanks (1 Reply)
Discussion started by: MAYAMAYA0451
1 Replies

7. Shell Programming and Scripting

Deleting files older than 6 hours

Hi All, I am using the below script to find all the files in a folder which are older than 6 hours and delete all those files, but some how I am not getting the required output. find $HOME/Log -type f -name "*.log" -amin +360 -exec rm *.* {} \ can any one please check and let me know... (13 Replies)
Discussion started by: subhasri_2020
13 Replies

8. Shell Programming and Scripting

Delete files older than 1 year through FTP

Hi All, I want to login to a remote server using FTP command and then check for files older than 1 year and delete those files. Please let me know how can i achieve this using Unix Commands. Thanks in Advance, (10 Replies)
Discussion started by: HemaV
10 Replies

9. Shell Programming and Scripting

Deleting Files Older than 1 hours.

How to Deleting Files Older than 1 hours. Base on SunOS. this file gen every 1 min. -rw-r--r-- 1 nobody nobody 4960 Jan 27 02:02 23_201301270201.log -rw-r--r-- 1 nobody amudu 2325 Jan 27 02:03 33_201301270202.log -rw-r--r-- 1 nobody amudu 3255 Jan 27 02:03... (2 Replies)
Discussion started by: ooilinlove
2 Replies

10. Shell Programming and Scripting

Need help deleting files one week older

Hi, I need to delete *.bad files which are 1 week old. How can I achieve that. I tried doing through below script but it deletes all the files. find ./ -mtime +7 -exec rm *.bad {} \; The below one works but i want to delete only files with .bad extension find . -mtime +7 | xargs rm (2 Replies)
Discussion started by: Gangadhar Reddy
2 Replies
BROWSER-HISTORY(1)					      General Commands Manual						BROWSER-HISTORY(1)

NAME
browser-history - external history of web browsers, such as netscape SYNOPSIS
browser-history [ options ] DESCRIPTION
Browser-History is a client-side X daemon maintaining a browser-independent global history of all the web sites you visited. Its usage is very simple, just put the following line in your .xinitrc or your X start-up script: browser-history & And open the file ~/.browser-history/history-log.html and bookmark it. Browser-history came from the will to overcome a Netscape bug: there was no global history, and if you close a window, its whole history is lost. For people browsing lots of sites, having a possibility to track back where one has been before means that you don't have to put everything in your bookmarks file. If you are not sure if a site may be worth remembering, don't add it in your bookmarks. If you need it later, just browse your history files. Later, it came to our minds that this also could be a valuable add-on to people writing experimental browsers, so they dont have to add this functionality to their browser itself. Browser-history is a small and efficient daemon. Real user services could be built on top of the log files it maintains for more possibili- ties (graphical representation, advanced search options, collective histories). It can be seen as a quick-and-dirty hack wrt to the general solution of using a personal proxy to provide this history and housekeeping facilities. But in the meantime, it is easy to use and it works. IMPLEMENTATION
Browser-History spies your web browser and logs in ~/.browser-history/history-log.html all the URLs you went through. You can then browse the log under Netscape or other browsers via the URL: file:~/.browser-history/history-log.html (replace the ~ by your home directory). It tracks automagically all already present browser windows, and all new ones created in the future. This program has no user interface. It just appends information to a log file in html format so you can browse it through a web browser. If more that one hour has passed since last entry, it draws an horizontal lines, and adds H1 headers to delimit new days. Each week (Sunday mornings), it archives the week his- tory, compresses it by gzip (that you must have in your path), and starts a new history with links to the older ones. To make room you can just remove the obsolete history files. You can search files for string XXX in shell via: zgrep XXX ~/.browser-history/* This version (2.6) works with Netscape, Arena and Amaya. URLs can be excluded from logging by putting them, one per line in the file ~/.browser-history/history-log.exclude , then, if an URL begins with a line from this file, it is not logged. In this file, empty lines or lines beginning by # are comments This file is read once at startup, and re-read when receiving the signal 1. e.g: # We exclude local files file: # Exclude search engines... http://home.netscape.com http://guide.infoseek.com When browser-history is run, it looks if another one is running, and by default it kills the previous one if it is an older version. Other- wise, it the new one is the same version number or older, it just aborts. OPTIONS
All options can be given by their first letter: you can specify either -verbose or -v, but you cannot group options, e.g. you must say -v -k , but not -vk -display display_name Specifies X display, otherwise contents of $DISPLAY is used -verbose outputs information on what it is doing. useful for debug. -Version prints version number and exit. -logdir directory which directory to store files into? defaults to ~/.browser-history -gzip gzip_filename the complete path to the gzip compressor. Defaults to "gzip". E.g: -gzip /usr/gnu/bin/gzip -seconds delay if two entries are made are more than delay seconds apart, an horizontal rule will separate them, else just a simple line break. Defaults to one hour (3600). -replace If there is an already running browser-history on the display, aborts. Default is to replace it only if the version is older than ours. -noreplace If there is an already running browser-history on the display, aborts. Default is to replace it only if the version is older than ours. -kill If there is an already running browser-history on the display, kills it, then terminates immediately in all cases. -DontGrab Never Grab the X Server, which might cause deadlocks while debugging, when browser-history or gdb tries to print on the grabbed xterm or emacs. -checkpoint Cause the currently running instance of browser-history to save a list of all the URLs and their titles that are currently being viewed by a browser-history compatible browser to the normal history file as a "checkpoint". LOG FILE FORMAT
A log file can have some decorative HTML to represent days, but each entry has the form: (on a single line since version 2.4) separator <b>name</b> <a href="URL">URL</a> YYYY/MM/DD-HH:MN:SS <small>windowid</small> where the following items are: separator: either <hr> or <br> name: the name of the document (window title) URL: its URL YYYY/MM/DD-HH:MN:SS: year, month number, day number, hour, minutes, seconds. (2-digit numbers) windowid: the X window ID of the browser window, in hexadecimal Note: Before version 2.4, the 4 sub-parts were separated by newlines, but since 2.4, they are only blank-separated to ease searching for URL in log files via "grep". Note: Before version 2.5, the year was stored in 2 digits. Now it is stored in 4 (or more :-) digits, to fix this Y2K bug HOME
The latest version of browser-history can be found at: http://koala.ilog.fr/ftp/pub/browser-history/ and its WWW home page, with full technical documentation is at: http://www.inria.fr/koala/colas/browser-history AUTHOR
Colas Nahaboo, http://www.inria.fr/koala/colas COPYRIGHT
browser-history bears the same license as the X Window System: you can do everything with this code (selling it, modifying it), except suing me or using my name in your advertisements, or expecting any kind of support or guarantee. local BROWSER-HISTORY(1)
All times are GMT -4. The time now is 05:42 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy