Sponsored Content
Top Forums Shell Programming and Scripting Tar with variable date in separate shell Post 303008171 by pradyumnajpn10 on Tuesday 28th of November 2017 05:49:22 AM
Old 11-28-2017
Thank you all for your kind time and reply .
I ve searched for my requirement and found somthing like below hence tried to modify that command.
Code:
#DIR=~/test/ sh -c 'cd $DIR; du -a | cut -d/ -f2 | sort | uniq -c | sort -nr'

But its seems Pushd and Popd is much simpler.I will go with it.
Code:
DIR=/root
pushd $DIR
tar cvf AWS.${testno}.${date}.tar ./AWS
popd

Thank you again for all your time.. Love unix.com
This User Gave Thanks to pradyumnajpn10 For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to separate a variable

Hi, This is what happened after I came back from vacation: I don't remember how to do some simple things anymore. I have a variable being passed in Kshell script. I only know the variable is like string: "str1 str2 str3 ....", and they are separated with blank spaces. I need to separate each... (4 Replies)
Discussion started by: whatisthis
4 Replies

2. Shell Programming and Scripting

shell script to selectively tar directory based on date

hye everybody :) , i'm new to the scripting world.. hope you guys can help me out with this one.. i'm trying to identify any directory under /tmp/saya that is created more than one day from the current date.. e.g, today is March 14, so any directory that has time stamp March 13 backwards, i... (2 Replies)
Discussion started by: fara_aris
2 Replies

3. UNIX for Dummies Questions & Answers

tar, zip multiple separate directories and move the results to another volume

TIA, I'm using FreeBSD 6 I have a series of Directories (A,B,C,...Z). Each directory has files and other directories within it. I want to compress the contents of each top directory into a single file so that I get an archive of each directory (for example, A.gzip) AND and want to move... (5 Replies)
Discussion started by: jccbin
5 Replies

4. Shell Programming and Scripting

Separate date timestamp use awk or sed command ?

Hi, I have logfile like this : Actually the format is date format : yyyymmddHHMMSS and i want the log become this format yyyy-mm-dd HH:MM:SS for example 2009-07-19 11:46:52 Can somebody help me ? Thanks in advance (3 Replies)
Discussion started by: justbow
3 Replies

5. Shell Programming and Scripting

Date variable in shell script

Hello guys n girls, I am using ksh script on AIX platform. I am getting a DATE from input file in "YYYYMMDDHHMISS" format. Now I want the same date in "YYYYMMDD" format into another variable. For example, if the DATE is 20101018121445 then I need 20101018 in another variable. Please... (6 Replies)
Discussion started by: Poonamol
6 Replies

6. Shell Programming and Scripting

Trying to take a string and break each letter into a separate variable

I am trying to make a script that takes a word and each letter up and turns it into a separate variable. My code currently does not work but I feel I just need to tweak one thing that I am unsure of. (ex: if forum was typed in letter1=f; letter2=o; letter3=r;...) Thank you count=1; ... (7 Replies)
Discussion started by: crimputt
7 Replies

7. Shell Programming and Scripting

Awk variable in a separate file

Hi all, I have a requirement to put all the varibles used in an awk command in a separate file. This is because i have arround 100 variables used in an awk command. So i want to put all the variables used for the awk command in a separate file. Please help me on this. Thanks in adv. (6 Replies)
Discussion started by: gani_85
6 Replies

8. Shell Programming and Scripting

How to separate a statement based on some delimiter and store each field in a variable?

Hi, Variable1 = MKT1,MKT2,MKT3,MKT4 Now i want to store each of these value seperated by comma to a array and access each of the values. Also find out number of such values seperated by comma. Variable1 can have any number of values seperated by comma. Thanks :) (3 Replies)
Discussion started by: arghadeep adity
3 Replies

9. Shell Programming and Scripting

Separate a hash variable into 2 parts in Perl

Dear Perl users/experts, Could somebody help me how to solve my problem, I have a hash variable that I want to convert into dot file (graphviz). I know how to convert it to dot file but I need some modification on the output of the hash variable before convert it to dot file. Eeach key of... (1 Reply)
Discussion started by: askari
1 Replies

10. Shell Programming and Scripting

Separate variable value

Friends, I have the following problem var=30|500; I need to keep those values in the variable other unique pattern that I have is | so should be var2=30; var3=500; I tried to use my split does not work Example failed var2=split("|",$var); var3=split("|",$var); (4 Replies)
Discussion started by: tricampeon81
4 Replies
PACOBALL(8)							      System							       PACOBALL(8)

NAME
pacoball - Binary package support for paco(8). SYNOPSIS
pacoball [-bgftv] [-d DIR] [-1..9] [-a|<packages>] pacoball -e [-ltv] [-C DIR] <pacoballs> DESCRIPTION
By default, pacoball may be given one or more package names as arguments, and for each of those packages it creates a binary tarball (.tar.bz2 or .tar.gz) containing all the currently installed files. For this to work the input packages have to be registered in the paco database. Leading slashes ('/') are stripped from the paths of the files in the tarballs. With option -e, pacoball admits one or more previously created tarballs ("pacoballs") as arguments, and installs them into the system, optionally logging the installation with paco. Mandatory arguments to long options are mandatory for short options too. GENERAL OPTIONS
-t, --test Test compressed file integrity. -h, --help Show usage information and exit. -v, --verbose Verbose output. -V, --version Display version information and exit. PACKAGE CREATION OPTIONS
-a, --all Create a pacoball for each package logged in the paco database. -d, --directory=DIR Create the pacoballs in directory DIR (default is '.'). -b, --bzip2 Compress with bzip2 (this is the default). -g, --gzip Compress with gzip. -# Set the compression level (speed/quality balance). '#' is a number between 1 (faster compression) and 9 (best compression). --fast An alias for -1. --best An alias for -9. -f, --force Force overwrite of existing output files. PACKAGE EXTRACTION OPTIONS
-e, --extract Extract (install) the given <pacoballs>, in directory '/' by default. -l, --log Log the file extraction with paco(8), retrieving the appropiate package name from the name of the pacoball. -C, --root=DIR Extract the files into directory DIR (as the -C option in tar). FILES
/etc/pacorc - paco configuration file /var/log/paco - default paco log directory WEB SITE
The latest version of pacoball should be always available at: http://paco.sourceforge.net COPYRIGHT
Copyright (C) 2004-2009 David Rosal <davidrr@sourceforge.net> This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICU- LAR PURPOSE. SEE ALSO
paco(8), pacorc(5), superpaco(8), rpm2paco(8) paco-2.0.9 28 June 2010 PACOBALL(8)
All times are GMT -4. The time now is 10:32 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy