Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Executing a tar command with the --exclude option in a Debian shell script. Post 302607389 by daveu7 on Wednesday 14th of March 2012 09:57:41 AM
Old 03-14-2012
Executing a tar command with the --exclude option in a Debian shell script.

Hi All,

I am trying to execute the following tar command with two --exclude options to suppress extract of the two directories specified.

Do I need to single quote the directory paths ??
Many thanks for your help.

The relevant code excerpt from the script is:

Code:
cd /var/www/${SITE}

 tar -cvf ${WORKING_BACKUP_ROOT}/${TAR_ARCHIVE_FILE} --exclude='/var/www/abcCompany/cache' \
                     --exclude='/var/www/abcCompany/administrator/cache' . >/${BACKUP_ROOT}/${ARCHIVE_LOG}


Last edited by daveu7; 03-14-2012 at 12:12 PM..
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

tar command with compress option...

Hi ! i have to write a script that archivs homes not used since 3 years. First, my script gathers the users that are concerned, using the following command : ll -lt /home/*/.sh_history | egrep '2000|1999|1998|1997' | awk '{print $3}' i obtain a list like this : user_1 user_2 ...... (3 Replies)
Discussion started by: tomapam
3 Replies

2. UNIX for Dummies Questions & Answers

TAR : option to exclude absolute path

Dear All , :D I have a question ... I need to exclude the absolute path in the TAR process. For example : system("tar cvf /root/BACKUPS_$fecha.tar /root/BKP/"); system("gzip /root/BACKUPS_$fecha.tar"); I need to exclude de path " /root/BKP/ " in the file.tar.gz What is the parameter to... (1 Reply)
Discussion started by: telco
1 Replies

3. Shell Programming and Scripting

Problem Executing Firmware Command using Shell Script

Guys, I have a script that should change one of the configuration Parameter in a http accelerator, this config change which will halt http traffic into device. So I have designed a script which should do these changes. But after executing this script, found that one of the input variable is not... (8 Replies)
Discussion started by: raghunsi
8 Replies

4. Shell Programming and Scripting

complicated exclude option in find command

Hi all, In a directory, I have many video files. Example : As you can see, some of the video files come with a .aspx file (wich means the video is actually being uploaded and not entirely written on the FS) I try to write a bash script that would find all video files in the ... (1 Reply)
Discussion started by: gniagnia
1 Replies

5. Shell Programming and Scripting

Executing a batch of files within a shell script with option to refire the individual files in batch

Hello everyone. I am new to shell scripting and i am required to create a shell script, the purpose of which i will explain below. I am on a solaris server btw. Before delving into the requirements, i will give youse an overview of what is currently in place and its purpose. ... (2 Replies)
Discussion started by: goddevil
2 Replies

6. Shell Programming and Scripting

working with tar exclude command

i have issue with tar, let me explain when i run below command it works perfectly as usual. tar -cvf /tmp/temp.tar --exclude="exclusion expression" dir my requirement is --exclude="exclusion expression" will come from another variable. so when i execute below command: tar -cvf... (2 Replies)
Discussion started by: ajayyadavmca
2 Replies

7. UNIX for Dummies Questions & Answers

Cron shell script not executing diskutil command

I'm trying to learn how to use cron for repetative tasks. I have an external disk that needs to be unmounted and remounted every hour due to some problems that a backup utility (specifically, TimeMachine) is having repeatedly accessing the device. I've created a shell script that will find the... (3 Replies)
Discussion started by: illuminate
3 Replies

8. AIX

Exclude Directories in my tar command

Hi, im having some issues after i execute the next command: tar -cvf /varios/restore/test.tar -X /jfma/test1/excludefile /jfma | gzip -c > /varios/restore/test.tar.gz this creates the desired "test.tar.gz" file, but whe i try to open it it says "tar: 0511-164 There is a media read or write... (6 Replies)
Discussion started by: blacksteel1988
6 Replies

9. Shell Programming and Scripting

Executing 'exit' command from shell script

Hi, I am writing shell script to automate few use cases for CLI interface. We have CLI interface which has bunch of commands. I am trying to execute one of the commands 'exit' as part of automation to exit from CLI object (not from shell script) in my shell script. My intension is to execute... (4 Replies)
Discussion started by: Mahesh Desai
4 Replies

10. Shell Programming and Scripting

Need Tar Ball command to exclude directories

Hi, uname -a SunOS mymac 5.11 11.2 sun4u sparc SUNW,SPARC-Enterprise I need to tar a folder /tmp/moht but do not want these three folders to be included in the tar file -> savejpg, bmpsave and imgsave I tried --exclude, -path, -not options but it says bad option Can you help me with... (3 Replies)
Discussion started by: mohtashims
3 Replies
DDIR(1) 						      cvs status - formatter							   DDIR(1)

NAME
ddir - display hierarchical directory tree SYNOPSIS
ddir [options] DIR DESCRIPTION
Display an indented directory tree using ASCII graphical characters to represent the hierarchical structure. The directories to include or exclude can be specified with command line options. Ddir is a Perl implementation of the tree(1) program. OPTIONS
-d, --dir Display only directories. -h, --help Print text help --help-exclude Print default exclude path value when --exclude-vcs is used. --help-html Print help in HTML format. --help-man Print help in manual page man(1) format. -i, --include REGEXP Include files mathing regexp. The match is done against whole path. The option can be used multiple times. If this option is not supplied, every file is automatically included. The matches can be further filtered by using options --exclude. -v, --verbose LEVEL Print informational messages. Increase numeric LEVEL for more verbosity. -V, --version Print contact and version information. -x, --exclude REGEXP Ignore files mathing regexp. The match is done against whole path. The option can be used multiple times. This option is applied after possible --include matches. -C, --exclude-vcs Exclude version control directories. See --help-exclude. EXAMPLES
Show directory tree by excluding version control directories. Display only directories: ddir --x-vcs --dir . . +--doc/ | +--manual/ +--bin/ TROUBLESHOOTING
None. EXAMPLES
None. ENVIRONMENT
None. FILES
None. SEE ALSO
tree(1) COREQUISITES
Uses standard Perl modules. AVAILABILITY
Homepage is at http://freshmeat.net/projects/ddir AUTHORS
Copyright (C) 1995-2010 Jari Aalto. Copyright (C) 1994 Brian Blackmore. LICENSE
This program is free software; you can redistribute and/or modify program under the terms of GNU General Public license either version 2 of the License, or (at your option) any later version. perl v5.10.1 2010-03-16 DDIR(1)
All times are GMT -4. The time now is 07:00 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy