Script to archive file


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Script to archive file
# 1  
Old 05-22-2007
Script to archive file

Hi All,

I am trying to archive a file. I have the script to archive a file which is given below:
#! /usr/bin/sh

INITFILE="US_Recon"
INITDIR="/var/opt/l2/CSN1/ap21"
TMPDIR="/var/opt/sap2bn/out/CSN1/ap21/tmp"
ARCHDIR="/var/opt/l2/CSN1/ap21"
FINALDIR="/var/opt/sap2bn/out/CSN1/ap21"
ARCHPER="31"
TIMESTAMP="_MMDDCCYY.xml"

/var/opt/l2/bin/archiveNx ${INITFILE} ${INITDIR} ${TMPDIR} ${ARCHDIR} ${FINALDIR} ${ARCHPER} ${TIMESTAMP}

In this do I use the whole script to archive a file or just the last command i.e. archiveNx to archive the file? If I use only the archiveNx command then should it come before the file name or after the file name.

Thanks a lot.

Regards,
Indira
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

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

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

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

4. Shell Programming and Scripting

Perl script to Archive the data file after the load

I have written a perl scripts which loads the data. Now i want to modify the script, to Archive the Input file after the successful load of data. Can anyone please share it and help me .... Thanks. (2 Replies)
Discussion started by: msrahman
2 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

need help archive script

Hi all, I am new to linux and scripting so please forgive me. I need to create a script that will archive files but the max size of the archive need to be 500mb or under. I know about the archiving with parts but i want all the archives as individual archives. Can anyone point me in the correct... (7 Replies)
Discussion started by: craig0
7 Replies

7. Shell Programming and Scripting

script help .. archive

Hi All We have a landing directory where source system puts files.There are variable number of files and the file names are also varying.Each files successful transmission is identified by a .done file.If file name is xyz.dat then the confirmation file will be xyz.dat.done. I want to... (1 Reply)
Discussion started by: dr46014
1 Replies

8. Shell Programming and Scripting

Archive script

hi guru, can advise how to construct a housekeeping script using perl for the following ? find /var/tmp/logs -name "si*" -type f -exec gzip -f {} \; find /var/tmp/logs -name "*.gz" -type f -exec mv -f {} /var/tmp/log \; I found out those are not working in shell at when put them on... (1 Reply)
Discussion started by: rauphelhunter
1 Replies

9. Shell Programming and Scripting

Generic Shell Script to Archive a file

Would appreciate if any one can paste a generic schell script to archive a file with date stamp by passing the file with fullpath as parameter For Eg. /apps/scripts/Archive_File.sh /data_home/project_home/file.txt this should place the file in the following directory ... (8 Replies)
Discussion started by: mak1600
8 Replies

10. Shell Programming and Scripting

File Archive Script

Hi There, I want to create a script that will archive files out of a log folder into seperate folders below it, but I need it to keep the previous 2 days worth of information. Now I know I can easily get a script to put the files in there but I don't know how to only get files older than 2 days,... (10 Replies)
Discussion started by: KeesH
10 Replies
Login or Register to Ask a Question
ELF_RAND(3)						   BSD Library Functions Manual 					       ELF_RAND(3)

NAME
elf_rand -- provide sequential access to the next archive member LIBRARY
ELF Access Library (libelf, -lelf) SYNOPSIS
#include <libelf.h> off_t elf_rand(Elf *archive, off_t offset); DESCRIPTION
The elf_rand() function causes the ELF descriptor archive to be adjusted so that the next call to elf_begin(3) will provide access to the ar- chive member at byte offset offset in the archive. Argument offset is the byte offset from the start of the archive to the beginning of the archive header for the desired member. Archive member offsets may be retrieved using the elf_getarsym(3) function. RETURN VALUES
Function elf_rand() returns offset if successful or zero in case of an error. EXAMPLES
To process all the members of an archive use: off_t off; Elf *archive, *e; ... cmd = ELF_C_READ; archive = elf_begin(fd, cmd, NULL); while ((e = elf_begin(fd, cmd, archive)) != (Elf *) 0) { ... process `e' here ... elf_end(e); off = ...new value...; if (elf_rand(archive, off) != off) { ... process error ... } } elf_end(archive); To rewind an archive, use: Elf *archive; ... if (elf_rand(archive, SARMAG) != SARMAG) { ... error ... } ERRORS
Function elf_rand() may fail with the following errors: [ELF_E_ARGUMENT] Argument archive was null. [ELF_E_ARGUMENT] Argument archive was not a descriptor for an ar(1) archive. [ELF_E_ARCHIVE] Argument offset did not correspond to the start of an archive member header. SEE ALSO
ar(1), elf(3), elf_begin(3), elf_end(3), elf_getarsym(3), elf_next(3), gelf(3) BSD
June 17, 2006 BSD