Dynamic includes file for tar command


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Dynamic includes file for tar command
# 1  
Old 03-08-2005
Dynamic includes file for tar command

I'm writing a script to tar a list of log files. The tar command calls an includes file, which lists all of the log files that I want.

My apache web server, however, creates a log file every day with the datestamp (mmddyy) at the end of it. I want the includes file to get the previous day's log file, but I don't know how to modify it so that it is dynamic.

Can variables be used in the includes file? If so, how?
# 2  
Old 03-09-2005
I think that you will need a variable for the date and hard code the log for apache.

Ex:

Yesterday=`date -d "yesterday" +"%m%d%y"`

filename="apache.$Yesterday"

Good luck
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

UNIX command to check if file name ends with .tar OR if the file is a tar file

Hello Team, Would you please help me with a UNIX command that would check if file is a tar file. if we dont have that , can you help me with UNIX command that would check if file ends with .tar Thanks in advance. (10 Replies)
Discussion started by: sanjaydubey2006
10 Replies

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

3. UNIX for Dummies Questions & Answers

command to run .tar file

How to install a file in unix with an extension .tar? (5 Replies)
Discussion started by: manisham
5 Replies

4. UNIX for Dummies Questions & Answers

Compress the file using Tar command

Hi, When i am tar the file particular ,csv file format in a folder i am receiving the error Command: tar cf New_data.tar /new/file/mari/getdata/small/*.xml Arguements too long But sometimes i am able to compress other folder but the tar folder contains all the file format and... (10 Replies)
Discussion started by: marivinay
10 Replies

5. Shell Programming and Scripting

tar command dont tar to original directory

HI, if I have a tarfile called pmapdata.tar that contains tar -tvf pmapdata.tar -rw-r--r-- 0/0 21 Oct 15 11:00 2009 /var/tmp/pmapdata/pmap4628.txt -rw-r--r-- 0/0 21 Oct 14 20:00 2009 /var/tmp/pmapdata/pmap23752.txt -rw-r--r-- 0/0 1625 Oct 13 20:00 2009... (1 Reply)
Discussion started by: borderblaster
1 Replies

6. UNIX for Dummies Questions & Answers

tar -cvf test.tar `find . -mtime -1 -type f` only tar 1 file

Hi all, 4 files are returned when i issue 'find . -mtime -1 -type f -ls'. ./ora_475244.aud ./ora_671958.aud ./ora_934052.aud ./ora_934050.aud However, when I issued the below command: tar -cvf test.tar `find . -mtime -1 -type f`, the tar file only contains the 1st file -... (2 Replies)
Discussion started by: ahSher
2 Replies

7. HP-UX

dynamic names for .tar.gz files?

Hi All, I have a requirement to zip and compress files with dynamic names (which includes date and time component in their names) needs to be compressed with same name. for example I have a file T.30.SLS_ORD.SO.27.2_2_2.20080623.041415.dat which needs to archived as... (1 Reply)
Discussion started by: srinivas_paluku
1 Replies

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

9. UNIX for Dummies Questions & Answers

file restoration to new directory - tar command

hi, i face some problem which need URGENT assistance. am performing a restoration for recovery in an AIX UNIX server. when i use the tar -tvf command to view the tape contents, it gives me /ata1/mydir/myfile. i understand that how the file was backed up determine whether we could restore... (2 Replies)
Discussion started by: newbie168
2 Replies

10. UNIX for Advanced & Expert Users

How to use the command Tar to find a file

Hello, I am just using the command Tar to find if a file was backuped on my tape. Can you help me with that command. I am using the command : tar -tvf /dev/rmt/4m /kcc_dms/AC7/c15a* > toto.txt to find all files c15a* in these subdirectories on my tape. But it doesn't work correctly. Can... (2 Replies)
Discussion started by: steiner
2 Replies
Login or Register to Ask a Question