Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Executing a tar command with the --exclude option in a Debian shell script. Post 302607907 by Corona688 on Thursday 15th of March 2012 03:56:37 PM
Old 03-15-2012
The backslashes are an issue, in a sense -- you missed one Smilie So it was trying to find a file named --exclude=... to execute.

If any of those folders contain spaces in their name, they need to be quoted. You might as well just quote all of them, to be safe. In double-quotes this time, since variables don't work inside single-quotes.
Code:
cd /var/www/"{SITE}"

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

 

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
RC-ALERT(1)						      General Commands Manual						       RC-ALERT(1)

NAME
rc-alert - check for installed packages with release-critical bugs SYNOPSIS
rc-alert [inclusion options] [--debtags [tag[,tag ...]] [--popcon] [package ...] rc-alert --help|--version DESCRIPTION
rc-alert downloads the list of release-critical bugs from the Debian BTS webpages, and then outputs a list of packages installed on the system, or given on the command-line, which are in that list. If the directory ~/.devscripts_cache exists or the --cache option is given, then the (sizable) downloaded list will be cached, and will only be downloaded again on a second invocation if it has changed. OPTIONS
--cache Force the creation of the ~/.devscripts_cache cache directory. --help, -h Show a summary of options. --version, -v Show version and copyright information. It is also possible to filter the list of bugs reported based on the tags and distributions associated with the package. The filtering options are: --include-tags, -f A list of tags which the bug must have, in the format used for output. For example, to include bugs tagged security or help wanted, use "SH". --include-tag-op, -t If set to and, a bug must have all of the tags specified by --include-tags. --exclude-tags A list of tags which the bug must not have, in the same format as --include-tags. --exclude-tag-op If set to and, a bug must have none of the tags specified by --exclude-tags. By default, the bug will be excluded if any tag matches. --include-dists, -d A list of distributions which the bug must apply to, in the format used for output. For example, to include bugs affecting testing or unstable, use "TU". --include-dist-op, -o If set to and, a bug must apply to all of the specified distributions in order to be included. --exclude-dists A list of distributions to which the bug must not apply, in the same format as --include-dists. --exclude-dist-op If set to and, a bug must apply to all of the specified distributions in order to be excluded. By default the bug will be excluded if it applies to any of the listed distributions. It is also possible to only list bugs which have specific debtags set. Note that you need to have debtags installed and also that it's not mandatory for maintainers to set proper debtags. The produced list will thus probably be incomplete. --debtags Match packages based on the listed tags. Each package is matched only if it has all the listed tags; in the case of multiple tags within the same facet, a package is matched if it has any of the listed tags within the facet. --debtags-database Use a non-standard debtags database. The default is /var/lib/debtags/packages-tags. Popularity-contest collects data about installation and usage of Debian packages. You can additionally sort the bugs by the popcon rank of the related packages. --popcon Sort bugs by the popcon rank of the package the bug belongs to. --pc-vote By default, packages are sorted according to the number of people who have the package installed. This option enables sorting by the number of people regularly using the package instead. This option has no effect in combination with --pc-local. --pc-local Instead of requesting remote data the information from the last popcon run is used (/var/log/popularity-contest). EXAMPLES
--include-dists OS The bug must apply to at least one of oldstable or stable --include-dists TU --include-dist-op and The bug must apply to both testing and unstable --include-dists O --include-tags S --exclude-tags + The bug must apply to oldstable and be tagged security but not patch --exclude-dists SOT --include-tags R The bug must apply to only unstable or experimental (or both) and be tagged unreproducible --debtags implemented-in::perl,role::plugin,implemented-in::python The bug must apply to packages matching the specified debtags, i.e. the match will only include packages that have the 'role::plug- in' tag and that have either of the tags 'implemented-in::perl' or 'implemented-in::python'. --popcon --pc-local Read /var/log/popularity-contest and sort bugs by your personal popcon ranking (which is basically the atime of your packages' bina- ries). BUGS
It is not possible to say "does not apply only to unstable" SEE ALSO
debtags(1) popbugs(1) popularity-contest(8) AUTHOR
rc-alert was written by Anthony DeRobertis and modified by Julian Gilbey <jdg@debian.org> and Adam D. Barratt <adam@adam-barratt.org.uk> for the devscripts package. Debtags and popcon functionality was added by Jan Hauke Rahm <info@jhr-online.de>. DEBIAN
Debian Utilities RC-ALERT(1)
All times are GMT -4. The time now is 04:01 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy