09-30-2009
Purge files and archive
Hi Friends,
I have an urgent requirement.
I have many files huge in size which has occupied almost the entire disk space. The files are not being moved to the archived folder.
But at present I need to purge those files, new to shell scripting, not sure how to proceed.
Eg.
Directory > /usr/logfiles/
Filenames > a1.log
a2.log
a3.log
a4.log
Please advise.
Thanks
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hello,
I currently generate a file every 15 minutes for 12 hours a day. I would like to clean the directory on a daily basis. I only want to keep the latest 3 versions for the last 4 days in the directory.
Any suggestions?
Thanks,
Barbara (7 Replies)
Discussion started by: blt123
7 Replies
2. Shell Programming and Scripting
Hi All,
I have a root directory /tmp and I want to purge files or archive files in its subsequent subfolders.I listed the path of files I want to purge(archive) and the #of days.
(purge)
DAYS PATH
7 /tmp/arsenal/*
5 /tmp/chelsea/*
(archive?
the same as above but different folders... (15 Replies)
Discussion started by: kayarsenal
15 Replies
3. UNIX for Dummies Questions & Answers
HI All,
I have recuirement to purge the files in a directory . In that directory i an having many sub-directory .
When i use find command like
find ~/work/test/insert -name "*.*" -mtime +12
it is listing the file not accesed before 12 , It also takes the subdirectories inside the... (7 Replies)
Discussion started by: arunkumar_mca
7 Replies
4. Shell Programming and Scripting
Dear All,
I have the followoing requirement..
REQ-1:
Suppose I have the following files
XX_20070202000101.zip
XX_20080223000101.zip
XX_20080226000101.zip
XX_20080227000101.zip
XX_20080228000101.zip
XX_20080229000101.zip
Suppose sysdate = 29 Feb 2007
I need to delete all files... (3 Replies)
Discussion started by: sureshg_sampat
3 Replies
5. Shell Programming and Scripting
I am writing a shell script for Archive Purge for the table having rows < 1 year. The shell script has to extract the rows from the table and write those extracted rows to a text file. Then from the text file, each rows will be read and deleted by means of delete query one by one. The fields will... (5 Replies)
Discussion started by: regnumber
5 Replies
6. Shell Programming and Scripting
Hi,
I am writing a shell script for archive data from a table.
The design is as follows.
Step 1:
Execute the select query and extract the data into a text file.
Step 2:
The primary key for this table is TRACKING_NUM, TRACKING_NUM_SUFFIX, TIMESTAMP_UPDATED. So These three fields will be read... (1 Reply)
Discussion started by: kmanivan82
1 Replies
7. Shell Programming and Scripting
I'm new to shell scripting... i have been given a task.. can any one help in this regard....
1) Check hourly for files in <destination-path><destination-file-template><destination-file-suffix> for files older than <destination-file-retention> days and purge. It should then check... (1 Reply)
Discussion started by: satishpabba
1 Replies
8. Shell Programming and Scripting
Hi Friends,
Very new in Unix and i got a requirement like writing a script and schedule it, so that it removes 30 days old files from all the log locations of a unix box.
Suppose i have a unix server ltbamdev1 and in this server i have a mount point opt/bam. In this mount point i have 3... (1 Reply)
Discussion started by: duos
1 Replies
9. Homework & Coursework Questions
Hi Unix Experts,
I am new in this filed.
I have assignment to Archive and purge the log file using shell scripts I tried I could not get the result please help me this.
Ex: test.log
requirement : using shell script I need to archive the log file and nil and the content of (test.log)... (1 Reply)
Discussion started by: johney1981
1 Replies
10. Shell Programming and Scripting
Hello All,
I am trying to purge X old days of files from directory & Sub directories
./2016-01-13/1500/abc.txt
./2016-01-14/1605/caf.txt
./2016-01-14/1605/caf2.txt
./2016-01-14/1606/eaf.txt
.....
./2017-08-1/1701/
Should also remove directories and sub directories too
Expected... (7 Replies)
Discussion started by: krux_rap
7 Replies
ar86(1) General Commands Manual ar86(1)
NAME
ar86 - Create, modify, and extract from archive file
SYNOPSIS
ar86 operation archive [file...]
ar86 positional-op member archive [file...]
DESCRIPTION
The ar86 program is used to create, examine and modify archive files produced by the Dev86/ELKS toolchain.
OPTIONS
The ar86 command requires that the operation to be performed on the archive be specified as the first option. If the operation is
positional then the next option is the archive member marking the position. This is followed by the archive file name and any list of file
names.
Operations
One of the following operations can be specified
d delete the listed files from the archive.
m move the named files. By default files are moved to the end of the archive unless a positional modifier is present.
p print the contents of archive members to standard out. If a file list is included only those members are printed. If the v modifier
is present each file's contents are preceeded by a new line, a line with the string member, a space character, the member name, and
two following newlines.
q quickly add the files to the end of the archive without checking to see if they already exist in the archive. This operation will
ignore any positional modifiers. Creates the archive file if it does not exist.
r replace archive members with the files listed. If the file name is not present in the archive it is added to the end of the archive
(or to any explicitly specified position). Creates the archive file if it does not exist.
t table; list the file names of archive members. If a file list is present only those files that are present in the archive are
listed. The v modifier prints member attributes.
x extract the named files from the archive into the current directory. If no files are specified all the archive members will be
extracted.
Modifiers
The following modifiers may be used with the operations
o original time stamps from the archive are preserved for extracted files when possible.
s symbol update; this option may be used by itself to force an update to the symbol definition section of the archive (the __.SYMDEF
member). If any files are specified they will be replaced as if the r operation had been specified. If no symbol definition section
exists one is created. This option will also creates the archive file if it does not exist.
u update files in the archive during a r (replace) operation. The files are added to the archive in exactly the same manner as replace
except that an existing archive member will be retained (in its original position) if it has a modified more recently than the file
being added. Note that this modifier acts as if a r operation has been specified (even it has not), and will actually override any
other previously specified operation.
v verbose; print additional diagnostic messages while processing the archive.
Positional Modifiers
The following modifiers specify where in the archive files are moved to or added. If any of these modifiers are specified then the second
option to ar86 must be the name of an archive member.
a after; files are placed after the specified archive member.
b before; files are placed before the specified archive member.
i same as b.
EXAMPLES
To see the contents of an archive
ar86 tv libfile.a
To add some files to an archive
ar86 r libfile.a file1.o file2.o
to add some files after a member named mem.o and to update the symbol table
ar86 rsa mem.o libfile.a file1.o file2.o
BUGS
A l modifier will be accepted but ignored.
RESTRICTIONS
This command is intended for use only with object files created using the Dev86/ELKS toolchain.
SEE ALSO
as86(1), bcc(1), ld86(1)
AUTHORS
(C) 1988, 1990 Free Software Foundation Inc. Changes for ar86 by Greg Haerr <greg@censoft.com>.
COPYRIGHT
The manual page was written for Debian GNU/Linux, (C) 2006 Shyamal Prasad <shyamal@member.fsf.org>. It is distributed under the terms of
the GNU General Public License version 2 (or any later version released by the Free Software Foundation).
May, 2006 ar86(1)