Sponsored Content
Top Forums Shell Programming and Scripting Generic Shell Script to Archive a file Post 302217810 by mak1600 on Wednesday 23rd of July 2008 03:25:21 PM
Old 07-23-2008
awesome...Thanks a lot for your help...a little bit of refinement...

For some directories it is ARCHIVE, for some archive and for some it is Archive.....How do I include this condition to check for the available archive directory
 

10 More Discussions You Might Find Interesting

1. 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

2. Shell Programming and Scripting

shell script for primary and standby DB archive log check

Hi All, OS:AIX 5.3 64 bits I would like the below script to send alert mail with the message - "Standby logs falling behind Primary" to xyz@yahoo.com Script ===== #!/usr/bin/ksh #----------------------------------------------------------------------------- # Use SQL*Plus to query... (1 Reply)
Discussion started by: a1_win
1 Replies

3. Shell Programming and Scripting

ftp, archive, email and delete from shell script

Hello, I found the forum’s information very helpful and informative. I am relatively new to UNIX programming. I am researching how to write a UNIX shell script to ftp all files from specific host folder to a client server. Also need to archive all transferred files, send a message (email) if any... (4 Replies)
Discussion started by: Lenora2009
4 Replies

4. Shell Programming and Scripting

Archive shell script

Hi, I'm new to Unix shell scripting and my first task is proving to be tricky. Please help where you can with pointers, tips, or examples of script. I'm self learning from the internet. I need to archive off files to another write protected directory according to the file names. ex.... (0 Replies)
Discussion started by: gorses
0 Replies

5. 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

6. Shell Programming and Scripting

ksh script to create a generic csv file from different source formats

Hi all, I have a requirement to create a "superset" file out of a number of different sources with some different and some same columns. We intend to have a manually updateable SuperSetCols.csv which would look like "ColA","ColB","ColC","ColD","ColE","ColF","ColG" so someday we may add... (3 Replies)
Discussion started by: Leedor
3 Replies

7. Shell Programming and Scripting

Shell script to call Oracle archive backup script when file system reaches threshold value

Hello All, I need immediate help in creating shell script to call archivebkup.ksh script when archive file system capacity reaches threshold value or 60% Need to identify the unique file system that reaches threshold value. ex: capacity ... (4 Replies)
Discussion started by: sasikanthdba
4 Replies

8. Shell Programming and Scripting

Required help on a Generic File-watcher script

Hi All, Good morning... I have prepared a shell script which will monitor files in a certain folder and if available, SCP it to a destination path. Now the challenge I'm facing is my script is currently SCP-ing to only a single destination path. Wherever different destination path is in... (1 Reply)
Discussion started by: saps19
1 Replies

9. Shell Programming and Scripting

Script to archive logs and sftp to another archive server

Requirement: Under fuse application we have placeholders called containers; Every container has their logs under: <container1>/data/log/fuse.log <container1>/data/log/fuse.log.1 <container1>/data/log/fuse.log.XX <container2>/data/log/fuse.log... (6 Replies)
Discussion started by: Arjun Goswami
6 Replies

10. UNIX for Beginners Questions & Answers

Generic script to load file details(ls -ltr) in to a database.

All, I am trying to create a report on the duration of an ETL load from the file arrival to the final dump in to a database for SLA's. Does anyone have any guidance or ideas on how metadata can be extracted; information of a file: like file name, created timestamp, count of records and load... (1 Reply)
Discussion started by: pradeepp
1 Replies
ARCHIVE(8)						      System Manager's Manual							ARCHIVE(8)

NAME
archive - Usenet article archiver SYNOPSIS
archive [ -a archive ] [ -c ] [ -f ] [ -i index ] [ -p newsgroups list ] [ -r ] [ input ] DESCRIPTION
Archive makes copies of files specified on its standard input. It is normally run either as a channel feed under innd(8), or by a script before expire(8) is run. Archive reads the named input file, or standard input if no file is given. The input is taken as a set of lines. Blank lines and lines starting with a number sign (``#'') are ignored. All other lines should specify the token of an article to archive. Every article is retrieved from a token and the Xref: header is used to determine the target file in the archive directory. You can limit the targets taken from the Xref: header with the ``-p'' option. Files are copied to a directory within the archive directory, <patharchive in inn.conf>. The default is to create a hierarchy that mimics the input files; intermediate directories will be created as needed. For example, if the input token represents article 2211 in the news- group comp.sources.unix, it will be copied to <patharchive in inn.conf>/comp/sources/unix/2211.) OPTIONS
-a archive If the ``-a'' flag is used then its argument specifies the directory to archive in instead of the default. -c If the ``-c'' flag is used, then all directory names will be flattened out, replacing the slashes with periods; and all posts will be concatenated into a single file with the final component name being YYYYMM which means the local execution time of archive(8). In this case, on December 14, 1998, the file would be copied to <patharchive in inn.conf>/comp.sources.unix/199812. Note: The ``-c'' flag implies the ``-f'' flag. -f If the ``-f'' flag is used, then all directory names will be flattened out, replacing the slashes with periods. In this case, the file would be copied to <patharchive in inn.conf>/comp.sources.unix/2211. -i If the ``-i'' flag is used, then archive will append one line to the specified index file for each article that it copies. This line will contain the destination name and the Message-ID and Subject headers. -p Limits the targets taken from the Xref: header to the groups specified in the newsgroups list. The newsgroups list is a comma sepa- rated wildmat(3) list of newsgroups you wish to have archive handle. -r By default, archive sets its standard error to <pathlog in inn.conf>/errlog. To suppress this redirection, use the ``-r'' flag. EXIT STATUS
If the input is exhausted, archive will exit with a zero status. If an I/O error occures, it will try to spool its input, copying it to a file. If there was no input filename, the standard input will be copied to <pathoutgoing in inn.conf>/archive and the program will exit. If an input filename was given, a temporary file named input.bch (if input is an absolute pathname) or <pathoutgoing in inn.conf>/input.bch (if the filename does not begin with a slash) is created. Once the input is copied, archive will try to rename this temporary file to be the name of the input file, and then exit. EXAMPLES
A typical newsfeeds(5) entry to archive most source newsgroups is as follows: source-archive :!*,*sources*,!*wanted*,!*.d :Tc,Wn :<PREFIX specified with --prefix at configure>/archive -f -i <patharchive in inn.conf>/INDEX HISTORY
Written by Rich $alz <rsalz@uunet.uu.net> for InterNetNews. This is revision 1.7.2.1, dated 2000/08/17. SEE ALSO
inn.conf(5), newsfeeds(5). ARCHIVE(8)
All times are GMT -4. The time now is 06:30 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy