Sponsored Content
Homework and Emergencies Homework & Coursework Questions Archive and purge the log file Post 302821385 by johney1981 on Friday 14th of June 2013 12:57:51 PM
Old 06-14-2013
Archive and purge the log file

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) file to 0 kb

and then in the archive folder log files are name to test.tar
test1.tar
test2.tar

EX:

/home/abc/
test.log 20000MB
after nil (content of file 0kb)

test.log 0kb


archive log file moved to

/home/abc/archive/

test.tar
test1.tar
test2.tar
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Read from file then purge or archive.

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

2. Shell Programming and Scripting

Purge files based on timestamp avl in file name

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

3. Shell Programming and Scripting

shell script for archive purge

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

4. Shell Programming and Scripting

script to archive and purge

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

5. Shell Programming and Scripting

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... (3 Replies)
Discussion started by: unx100
3 Replies

6. Shell Programming and Scripting

moving log file into Archive directory

Hi All, I'm trying to write a script which will do following : - For any old log under trace directory, if found move it to Archive - Check for a process “process-A” if it is running abort from the script - Else start it up (start_process-A.sh this case) - If it fails to start the... (1 Reply)
Discussion started by: mohullah
1 Replies

7. Shell Programming and Scripting

Need a script or one-liner to purge lines from a file.

i all. This one sounds so simple, but I can't get it to work. I need to delete lines with certain keywords from a file. I have a file called defaultRules, with keywords: IPSEC_AH IKE_UDP IPMP_TEST_IFACE2 Then, I have another file called rules.txt with some rules: ... (10 Replies)
Discussion started by: BRH
10 Replies

8. UNIX for Advanced & Expert Users

Purge MAil file

Hi, merry christmas. on AIX 6.1, the file /var/spool/mail/user, should/can be purged manually ? Any commande line to purge it ? Thanks. (2 Replies)
Discussion started by: big123456
2 Replies

9. Shell Programming and Scripting

Create archive and nil the content of log file using script

Plese help I need a urgent requirement. Ex: test.log requirement : using shell script I need to archive the log file and nil and the content of (test.log) file to 0 kb and then in the archive folder log files are name to test.tar test1.tar test2.tar EX: /home/abc/ test.log ... (1 Reply)
Discussion started by: johney1981
1 Replies

10. Shell Programming and Scripting

Log archive

Hi, I am trying to move old file to archive folder. find /sourcedirectory/logs/* -type f -mtime +30 -exec mv "{}" /sourcedirectory/logs/archive \; The above command not only search for old file in /sourcedirectory/logs/ folder but also searchs in /sourcedirectory/logs/archive ( what... (3 Replies)
Discussion started by: lpprasad321
3 Replies
Archive::Any(3pm)					User Contributed Perl Documentation					 Archive::Any(3pm)

NAME
Archive::Any - Single interface to deal with file archives. SYNOPSIS
use Archive::Any; my $archive = Archive::Any->new($archive_file); my @files = $archive->files; $archive->extract; my $type = $archive->type; $archive->is_impolite; $archive->is_naughty; DESCRIPTION
This module is a single interface for manipulating different archive formats. Tarballs, zip files, etc. new my $archive = Archive::Any->new($archive_file); my $archive = Archive::Any->new($archive_file, $type); $type is optional. It lets you force the file type in-case Archive::Any can't figure it out. extract $archive->extract; $archive->extract($directory); Extracts the files in the archive to the given $directory. If no $directory is given, it will go into the current working directory. files my @file = $archive->files; A list of files in the archive. mime_type my $mime_type = $archive->mime_type(); Returns the mime type of the archive. is_impolite my $is_impolite = $archive->is_impolite; Checks to see if this archive is going to unpack into the current directory rather than create its own. is_naughty my $is_naughty = $archive->is_naughty; Checks to see if this archive is going to unpack outside the current directory. DEPRECATED
type my $type = $archive->type; Returns the type of archive. This method is provided for backwards compatibility in the Tar and Zip plugins and will be going away soon in favor of "mime_type". PLUGINS
For detailed information on writing plugins to work with Archive::Any, please see the pod documentation for Archive::Any::Plugin. AUTHOR
Clint Moore <cmoore@cpan.org> AUTHOR EMERITUS
Michael G Schwern SEE ALSO
Archive::Any::Plugin SUPPORT
You can find documentation for this module with the perldoc command. perldoc Archive::Any You can also look for information at: o AnnoCPAN: Annotated CPAN documentation <http://annocpan.org/dist/Archive-Any> o CPAN Ratings <http://cpanratings.perl.org/d/Archive-Any> o RT: CPAN's request tracker <http://rt.cpan.org/NoAuth/Bugs.html?Dist=Archive-Any> o Search CPAN <http://search.cpan.org/dist/Archive-Any> LICENSE
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See <http://www.perl.com/perl/misc/Artistic.html> perl v5.10.0 2008-06-25 Archive::Any(3pm)
All times are GMT -4. The time now is 01:17 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy