06-23-2008
You would have to tell use what parts of the filename are variable but the date and time parts are easy. If this is only a single file then I am not sure why you would TAR it ( tar does nothing but put a wrapper around a single file).
FILE=T.30.SLS_ORD.SO.27.2_2_2.
DATE=`date +%Y%m%d`
TIME=`date +%T|tr -d:`
NEWFILE="$FILE$DATE$TIME"
echo "new file is called $NEWFILE"
#tar up the file
tar cvf $NEWFILE.tar $NEWFILE
#Zip it up
gzip $NEWFILE.tar
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
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... (1 Reply)
Discussion started by: kadishmj
1 Replies
2. Shell Programming and Scripting
Say I write something like the following:
var1=1
var2=2
for int in 1 2
do
echo "\$var$int"
done
I want the output to be:
1
2
Instead I get something like:
$var1
$var2 (2 Replies)
Discussion started by: Awanka
2 Replies
3. Shell Programming and Scripting
Hi,
I am new to shell script. This is my first post .I have written a small script which returns list of names starts with "ram" in /etc/passwd .Here is that:-
#!/bin/ksh
NAME_LIST="name_list.txt"
cat /dev/null > $NAME_LIST
evalcmd="cat /etc/passwd | grep "^ram?*" | cut -d: -f1"
eval... (3 Replies)
Discussion started by: sachin.tendulka
3 Replies
4. UNIX for Advanced & Expert Users
Hi,
On my Unix Server in my directory, I have 70 files distributed in the following directories (which have several other files too). These files include C Source Files, Shell Script Source Files, Binary Files, Object Files.
a) /usr/users/oracle/bin
b) /usr/users/oracle... (1 Reply)
Discussion started by: marconi
1 Replies
5. Red Hat
Hello,
when i start to take backup following error generate please share solution for this problem i am very thankful to you.
$ tar -czvf orahome.tar.gz /testhome/TEST/PROD/orahome/
tar: Removing leading `/' from member names
O.S 4.5 Red Hat
Thanks,
Umair (1 Reply)
Discussion started by: umair
1 Replies
6. Shell Programming and Scripting
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
7. Web Development
Hey everyone. Thanks for looking at this.
I'm trying to create a table with the dynamic name of TableName + today's date.
My variables are all happily created but the system chokes when I try to create the new table name example:
Set @BFBW = CONCAT("BFBW", CURDATE());
Select @BFBW;
... (2 Replies)
Discussion started by: Astrocloud
2 Replies
8. Shell Programming and Scripting
i=0
while
do
sizesfor0=`cat 16 | grep 'pickSize' -A 1 | grep '_sz' | cut -d'_' -f1`
sizesfor0=${sizesfor0//id=\"lll/:}
IFS=: array0=( $sizesfor0 )
echo ${array0}
i=$(( $i + 1 ))
done
So, right now I have two variables in the while statement above
sizesfor0 and array0
The... (1 Reply)
Discussion started by: phpchick
1 Replies
9. Shell Programming and Scripting
I have a .CSV file (frequency - weekly) whose header contains the year-week value in two of the columns which keeps changing every week. For an instance please see below.
Column1,Column2,Column3,Column4,Column5,Column6,Column7,Column8,Column9,Column10,Column11,Column12,Column13,201420... (4 Replies)
Discussion started by: dhruuv369
4 Replies
10. Shell Programming and Scripting
hi all,
i attach a link with what im trying to do automatically via script but i have some questions i need answering please, bear in mind i am really new to bash scripting, the only thing i know how to do is commands in scripts like cd rm tar rsync cp stuff like that
i have mutiple project... (48 Replies)
Discussion started by: robertkwild
48 Replies
deb(5) Debian deb(5)
NAME
deb - Debian binary package format
SYNOPSIS
filename.deb
DESCRIPTION
The .deb format is the Debian binary package file format. It is understood by dpkg 0.93.76 and later, and is generated by default by all
versions of dpkg since 1.2.0 and all i386/ELF versions since 1.1.1elf.
The format described here is used since Debian 0.93; details of the old format are described in deb-old(5).
FORMAT
The file is an ar archive with a magic value of !<arch>. The file names might contain a trailing slash.
The tar archives currently allowed are, the old-style (v7) format, the pre-POSIX ustar format, a subset of the GNU format (only the new
style long pathnames and long linknames, supported since dpkg 1.4.1.17), and the POSIX ustar format (long names supported since dpkg
1.15.0). Unrecognized tar typeflags are considered an error.
The first member is named debian-binary and contains a series of lines, separated by newlines. Currently only one line is present, the for-
mat version number, 2.0 at the time this manual page was written. Programs which read new-format archives should be prepared for the minor
number to be increased and new lines to be present, and should ignore these if this is the case.
If the major number has changed, an incompatible change has been made and the program should stop. If it has not, then the program should
be able to safely continue, unless it encounters an unexpected member in the archive (except at the end), as described below.
The second required member is named control.tar.gz. It is a gzipped tar archive containing the package control information, as a series of
plain files, of which the file control is mandatory and contains the core control information. The control tarball may optionally contain
an entry for `.', the current directory.
The third, last required member is named data.tar. It contains the filesystem as a tar archive, either not compressed (supported since
dpkg 1.10.24), or compressed with gzip (with .gz extension), xz (with .xz extension, supported since dpkg 1.15.6), bzip2 (with .bz2 exten-
sion, supported since dpkg 1.10.24) or lzma (with .lzma extension, supported since dpkg 1.13.25).
These members must occur in this exact order. Current implementations should ignore any additional members after data.tar. Further members
may be defined in the future, and (if possible) will be placed after these three. Any additional members that may need to be inserted
before data.tar and which should be safely ignored by older programs, will have names starting with an underscore, `_'.
Those new members which won't be able to be safely ignored will be inserted before data.tar with names starting with something other than
underscores, or will (more likely) cause the major version number to be increased.
SEE ALSO
deb-old(5), dpkg-deb(1), deb-control(5).
Debian Project 2009-02-27 deb(5)