Simple Bash Script:ignoring --exclude?


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Simple Bash Script:ignoring --exclude?
# 1  
Old 05-05-2011
Simple Bash Script:ignoring --exclude?

My super simple script works fine when I type it in manually but when I run it from a file as a script the --exclude option is ignored...what am I missing here?


#!/usr/bin/bash
tar czvf PackUpCases case0* log* --exclude runtpe
# 2  
Old 05-05-2011
--exclude-from=FILE
# 3  
Old 05-05-2011
Quote:
Originally Posted by Shaun74
--exclude-from=FILE
I don't understand what you mean can you elaborate a bit I tried:

tar czvf PackUpCases case0* log* --exclude-runtpe
tar czvf PackUpCases case0* log* --exclude-from=runtpe

and they both failed...
# 4  
Old 05-05-2011
are you trying to exclude a file from an archive? If you man tar, it is used to manipulate files and directories from an archive.
# 5  
Old 05-05-2011
Quote:
Originally Posted by Shaun74
are you trying to exclude a file from an archive? If you man tar, it is used to manipulate files and directories from an archive.
Yes I am packing up a series of case directoreis and excluding a file with in all of them called runtpe. When I run the script manually it works like it is suppose to. But when I excute the bash script within the shell the exclude option is ignored (e.g., runtpe files are included in the tar file).

---------- Post updated 05-05-11 at 07:06 AM ---------- Previous update was 05-04-11 at 08:46 PM ----------

Anyone?

---------- Post updated at 12:11 PM ---------- Previous update was at 07:06 AM ----------

Not sure what fixed it but this code is working:

Code:
#!/usr/bin/bash
tar czvf PackUpCases case0* log* --exclude runtpe

# 6  
Old 05-06-2011
I am wondering if you had some hung processes?
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Simple bash script menu

Dear Sir, May I know how do I go about adding the following feature into the script below: When user enter values other than 1,2,3,4, a) Message “Wrong entry !!! Pls select 1,2,3 or 4” is displayed b) The screen is cleared again and the menu is displayed. #!/bin/bash clear var=1... (2 Replies)
Discussion started by: fusetrips
2 Replies

2. Shell Programming and Scripting

Help making simple perl or bash script to create a simple matrix

Hello all! This is my first post and I'm very new to programming. I would like help creating a simple perl or bash script that I will be using in my work as a junior bioinformatician. Essentially, I would like to take a tab-delimted or .csv text with 3 columns and write them to a "3D" matrix: ... (16 Replies)
Discussion started by: torchij
16 Replies

3. Shell Programming and Scripting

Simple bash script help

Hi to everyone here, I'm a new user and relatively-new linuxer. I'm trying to write a script that checks if every file from a directory is present in a given list and if not, delete it. should be simple. But I think I've done half the work only: this is to create the reference list: for c... (2 Replies)
Discussion started by: dentex
2 Replies

4. Shell Programming and Scripting

Simple bash script problem

#!/bin/bash cd /media/disk-2 Running ./run.sh it's not changing directory.Why? (6 Replies)
Discussion started by: cola
6 Replies

5. Shell Programming and Scripting

need a simple bash script

to gather the cpu utilization from a system in 5 minute intervals and direct output to file. I'm new at scripting and while this seems like an easy task I'm confused on where to start. thanks for any help (1 Reply)
Discussion started by: mkeyes001
1 Replies

6. Shell Programming and Scripting

Help with writing simple bash script

I want to write a bash script to: 1. Send an email from localhost to an external gmail account. (gmail then automatically forwards the message back to a pop account on the same server. 2. Script waits 3 minutes then checks to see if the email arrived, and if not, it sends an email to... (9 Replies)
Discussion started by: sallyanne
9 Replies

7. Shell Programming and Scripting

Simple BASH script not working?

So I need a script that does the following: If a certain user is logged in Run `command` Else Echo “incorrect user” This is my first stab...which doesn't work: #!/bin/bash X="user=`ls -l /dev/console | cut -d " " -f 4`" Y="foobar" echo $X echo $Y (4 Replies)
Discussion started by: doubleminus
4 Replies

8. Shell Programming and Scripting

simple bash script

I am writing a shell script in bash one of the thing I want to show is size of export /home du -sk /export/home/oracle | cut -c 1-5 echo "kbytes" when I run the script kbytes shows up in the second line, How can I append kbytes on the same line, such as 61233 kbytes please guide thanks (2 Replies)
Discussion started by: Tirmazi
2 Replies

9. Shell Programming and Scripting

Simple BASH script?

Hi guys, I'm new to the forum so forgive me if I'm sounding ... daft. I currently work in a Tech Support role. Every day we have to generate data by running around 10 .sh scripts. I was thinking instead of having to ./filename 10 times is it possible to right a new script that will run these for... (16 Replies)
Discussion started by: JayC89
16 Replies

10. Shell Programming and Scripting

Simple Bash Script

I'm sure I'm doing something wrong but as I am new to bash shell scripting I'm not sure what: Here's the code webalizer.conf is sitting in the same directory as this file which is named webalizer.sh. Can someone tell me if I've got the syntax right -- it that's correct? I'm executing the... (3 Replies)
Discussion started by: xaphalanx
3 Replies
Login or Register to Ask a Question