Help with tar --append command output redirection


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Help with tar --append command output redirection
# 1  
Old 02-01-2011
Question Help with tar --append command output redirection

I am using tar command to append daily database backups on tape. "tar --append " command help me to do this.
But tar --append command does not produce any output on stdout if it succeed.
I want the output for that appended command to a log file.
This log file should contain only the name of the files which are appended.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Programming

Python script to run multiple command and append data in output csv file

Experts, I am writing a script and able to write only small piece of code and not able to collect logic to complete this task. In input file have to look for name like like this (BGL_HSR_901_1AG_A_CR9KTR10) before sh iss neors. Record this (BGL_HSR_901_1AG_A_CR9KTR10) in csv file Now have to... (0 Replies)
Discussion started by: as7951
0 Replies

2. Shell Programming and Scripting

Command output redirection to file issues

Hi, I have a peculiar issue w.r.t redirecting the command output to a file when using loop. I am redirecting command output to same file in a series of if condition statements, but if one block of if condition statement writes the log to the file , the subsequent block of if condition... (7 Replies)
Discussion started by: ananan
7 Replies

3. Shell Programming and Scripting

Append files (backup .tar)

Hi all, I have to write a script which will keep for a particular user (username is first argument) backups of the account area to another. The script should accept as the second argument is a directory (or file), create one by storing a copy of the argument (using tar) and copies it to the list... (0 Replies)
Discussion started by: peter20
0 Replies

4. Shell Programming and Scripting

How to append a value to the output after using sed command?

Hi All, I have a file where I am converting newlines to comma separated values but I would like to append zero if the output is empty Here is the command I am using sed -n -e 'H;${x;s/\n/,/g;s/^,//;p;}' test1.txt test1.txt will have comma seperated values but sometimes this file can be... (6 Replies)
Discussion started by: rajeevm
6 Replies

5. Shell Programming and Scripting

awk - append date to output of a command

Hi all; I am running a script:/var/tmp/gcsw -ne | grep "State:2" | wc that gives me output like:80 480 6529 but i need this output as:2013-01-18 13:00 -> 80 480 6529 (1 Reply)
Discussion started by: gc_sw
1 Replies

6. Shell Programming and Scripting

Command output redirection in script not working

I need to count the number of lines in a .txt file and put it in a variable. I am using the following code #!/bin/bash count = $(wc -l "some file.txt" | awk '{print$1}') echo $count It is giving the following error. line3: count: command not foundWhat am I doing wrong here? :confused: (7 Replies)
Discussion started by: haritha.gorijav
7 Replies

7. UNIX for Dummies Questions & Answers

Dot and redirected output syntax in a tar command

Hi All, Please could anyone advise what the purpose of the dot syntax in the following command means: tar -cvf ${WORKING_BACKUP_ROOT}/${TAR_ARCHIVE_FILE} . >/${BACKUP_ROOT}/${ARCHIVE_LOG} Many thanks (2 Replies)
Discussion started by: daveu7
2 Replies

8. UNIX and Linux Applications

output redirection command

Dear All, ./waf --run scratch/myfirst > log.out 2>&1 The above is a command line to redirect the output to a file called log.out. what is the 2>&1 part for ? Thank you (2 Replies)
Discussion started by: knowledgeSeeker
2 Replies

9. Shell Programming and Scripting

tar command to explore multiple layers of tar and tar.gz files

Hi all, I have a tar file and inside that tar file is a folder with additional tar.gz files. What I want to do is look inside the first tar file and then find the second tar file I'm looking for, look inside that tar.gz file to find a certain directory. I'm encountering issues by trying to... (1 Reply)
Discussion started by: bashnewbee
1 Replies

10. AIX

append file with tar command

hello, can i append files into tape without clear this tape thanks for help (3 Replies)
Discussion started by: mbakry23
3 Replies
Login or Register to Ask a Question
tar_append_file(3)						  C Library Calls						tar_append_file(3)

NAME
tar_append_file, tar_append_eof, tar_append_regfile - append data to tar archives SYNOPSIS
#include <libtar.h> int tar_append_file(TAR *t, char *realname, char *savename); int tar_append_regfile(TAR *t, char *realname); int tar_append_eof(TAR *t); VERSION
This man page documents version 1.2 of libtar. DESCRIPTION
The tar_append_file() function creates a tar file header block describing the file named by the realname argument, but with the encoded filename of savename. It then sets the current header associated with the TAR handle t to the newly created header block, and writes this block to the tar archive associated with t. If the file named by realname is a regular file (and is not encoded as a hard link), tar_append_file() will call tar_append_regfile() to append the contents of the file. The tar_append_regfile() function appends the contents of a regular file to the tar archive associated with t. Since this function is called by tar_append_file(), it should only be necessary for applications that construct and write the tar file header on their own. The tar_append_eof() function writes an EOF marker (two blocks of all zeros) to the tar file associated with t. RETURN VALUES
On successful completion, these functions will return 0. On failure, they will return -1 and set errno to an appropriate value. ERRORS
The tar_append_*() functions will fail if: EINVAL Less than T_BLOCKSIZE bytes were written to the tar archive. EINVAL Less than T_BLOCKSIZE bytes were read from the realname file. They may also fail if any of the following functions fail: lstat(), malloc(), open(), read(), th_write(), or the write function for the file type associated with the TAR handle t. SEE ALSO
read(2), open(2), lstat(2), th_write(3) University of Illinois Jan 2001 tar_append_file(3)