Sponsored Content
Top Forums Shell Programming and Scripting moving log file into Archive directory Post 302453612 by frank_rizzo on Wednesday 15th of September 2010 11:10:56 PM
Old 09-16-2010
For the future please use [CODE] tags around the logic. Please review the forum rules.

Let's assume(might not a good assumption) that start_process-A.sh will return a non-zero return code on error. You can check the return code just like you did with the grep. This gets more complicated when trying to check the return code from a program in the pipeline. Do you really need use tee? Can you just append(>>) to ${LOGFILE}? If you really need the output in the current script and the log file then you have to be more creative. I will wait for you response before going down that route. Do you know if the shell is ksh93?
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Create Year directory, date subdirectory and archive the file

Hi, After checking all the UNIX threads, I am able to come up with a solution so far. I am working on a shell script where it moves the files to a certain directory. The conditions to check are 1) Check if the file exists in the current directory. 2) Check if the destination directory... (2 Replies)
Discussion started by: madhunk
2 Replies

2. Shell Programming and Scripting

Moving file to directory based on condition.

Can any one help me to correct following script. I have 2 directories DropZone and ProcessZone. File pattern is *VEHDESCSUM*. Finding the 'no of files' in DropZone directory using ls *VEHDESCSUM* |wc -l If DropZone has more than one file or 0 files then exit 1 If DropZone has one file then... (2 Replies)
Discussion started by: ramanagh
2 Replies

3. Shell Programming and Scripting

moving file to directory in script

hi i am reading files from directory,if the files matches certain condition i need to move that file to another directory i am using if then mv $file1 > $UNIQDIR fi but i am gettin error , please help thanks Satya (4 Replies)
Discussion started by: Satyak
4 Replies

4. Shell Programming and Scripting

ftp a file after checking the versions not greater then 8 in archive directory

Hi , I want to write a FTP Script which checks the No of Vesions of the files in Archive Dir and if count >= 8 Delete the oldest file from the Archive Dir and if the count is <= 8 Move the file to the Archive Dir with a CurrentDate concatenation and FTP the file to the FTP directory and send... (1 Reply)
Discussion started by: kailash.jadhav
1 Replies

5. Shell Programming and Scripting

Moving files listed in a data file to a new directory using Perl

Hi, I have a data file that lists a number of files. I want to move the files named in that one to another directory. Here's what I have: #!/usr/bin/perl -w open(FILE, "<collision.txt"); my @lines=<FILE>; foreach my $lines (@lines) { system("mv $lines collisions/."); } close(FILE); ... (2 Replies)
Discussion started by: renthead720
2 Replies

6. Shell Programming and Scripting

Shell Script for moving 3 days old file to Archive Folder

Hi Experts, I have a "Source" folder which may contain some files. I need a shell script which should move all files which are older than 3 days to "Archive" folder. Thanks in Advance... (4 Replies)
Discussion started by: phani333
4 Replies

7. Shell Programming and Scripting

Grepping file names, comparing them to a directory of files, and moving them into a new directory

got it figured out :) (1 Reply)
Discussion started by: sHockz
1 Replies

8. UNIX for Dummies Questions & Answers

Reading the dates from a file & moving the files from a directory

Hi All, I am coding for a requirement where I need to read a file & get the values of SUB_DATE. Once the dates are found, i need to move the files based on these dates from one directory to another. ie, this is how it will be in the file, SUB_DATE = 20120608,20120607,20120606,20120606... (5 Replies)
Discussion started by: dsfreddie
5 Replies

9. Homework & Coursework Questions

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)... (1 Reply)
Discussion started by: johney1981
1 Replies

10. Shell Programming and Scripting

Moving Files one directory to another directory shell script

Hi, Could you please assist how to move the gz files which are older than the 90 days from one folder to another folder ,before that it need to check the file system named "nfs" if size is less than 90 or not. If size is above 90 then it shouldn't perform file move and exit the script throwing... (4 Replies)
Discussion started by: venkat918
4 Replies
TAP::Harness::Archive(3pm)				User Contributed Perl Documentation				TAP::Harness::Archive(3pm)

NAME
TAP::Harness::Archive - Create an archive of TAP test results SYNOPSIS
use TAP::Harness::Archive; my $harness = TAP::Harness::Archive->new(\%args); $harness->runtests(@tests); DESCRIPTION
This module is a direct subclass of TAP::Harness and behaves in exactly the same way except for one detail. In addition to outputting a running progress of the tests and an ending summary it can also capture all of the raw TAP from the individual test files or streams into an archive file (".tar" or ".tar.gz"). METHODS
All methods are exactly the same as our base TAP::Harness except for the following. new In addition to the options that TAP::Harness allow to this method, we also allow the following: archive This is the name of the archive file to generate. We use Archive::Tar in the background so we only support ".tar" and ".tar.gz" archive file formats. This can optionally be an existing directory that will have the TAP archive's contents deposited therein without any file archiving (no Archive::Tar involved). extra_files This is an array reference to extra files that you want to include in the TAP archive but which are not TAP files themselves. This is useful if you want to include some log files that contain useful information about the test run. extra_properties This is a hash reference of extra properties that you've collected during your test run. Some things you might want to include are the Perl version, the system's architecture, the operating system, etc. runtests Takes the same arguments as TAP::Harness's version and returns the same thing (a TAP::Parser::Aggregator object). The only difference is that in addition to the normal test running and progress output we also create the TAP Archive when it's all done. aggregator_from_archive This class method will return a TAP::Parser::Aggregator object when given a TAP Archive to open and parse. It's pretty much the reverse of creating a TAP Archive from using "new" and "runtests". It takes a hash of arguments which are as follows: archive The path to the archive file. This can also be a directory if you created the archive as a directory. This is required. parser_callbacks This is a hash ref containing callbacks for the TAP::Parser objects that are created while parsing the TAP files. See the TAP::Parser documentation for details about these callbacks. made_parser_callback This callback is executed every time a new TAP::Parser object is created. It will be passed the new parser object, the name of the file to be parsed, and also the full (temporary) path of that file. meta_yaml_callback This is a subroutine that will be called if we find and parse a YAML file containing meta information about the test run in the archive. The structure of the YAML file will be passed in as an argument. my $aggregator = TAP::Harness::Archive->aggregator_from_archive( { archive => 'my_tests.tar.gz', parser_callbacks => { plan => sub { warn "Nice to see you plan ahead..." }, unknown => sub { warn "Your TAP is bad!" }, }, made_parser_callback => sub { my ($parser, $file, $full_path) = @_; warn "$file is temporarily located at $full_path "; } } ); AUTHOR
Michael Peters, "<mpeters at plusthree.com>" BUGS
Please report any bugs or feature requests to "bug-tap-harness-archive at rt.cpan.org", or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=TAP-Harness-Archive <http://rt.cpan.org/NoAuth/ReportBug.html?Queue=TAP-Harness-Archive>. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes. SUPPORT
You can find documentation for this module with the perldoc command. perldoc TAP::Harness::Archive You can also look for information at: o AnnoCPAN: Annotated CPAN documentation http://annocpan.org/dist/TAP-Harness-Archive <http://annocpan.org/dist/TAP-Harness-Archive> o CPAN Ratings http://cpanratings.perl.org/d/TAP-Harness-Archive <http://cpanratings.perl.org/d/TAP-Harness-Archive> o RT: CPAN's request tracker http://rt.cpan.org/NoAuth/Bugs.html?Dist=TAP-Harness-Archive <http://rt.cpan.org/NoAuth/Bugs.html?Dist=TAP-Harness-Archive> o Search CPAN http://search.cpan.org/dist/TAP-Harness-Archive <http://search.cpan.org/dist/TAP-Harness-Archive> ACKNOWLEDGEMENTS
o A big thanks to Plus Three, LP (<http://www.plusthree.com>) for sponsoring my work on this module and other open source pursuits. o Andy Armstrong COPYRIGHT &; LICENSE Copyright 2007 Michael Peters, all rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.12.4 2011-09-04 TAP::Harness::Archive(3pm)
All times are GMT -4. The time now is 10:44 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy