![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| help me in sending parameters from sqlplus script to unix shell script | Hara | Shell Programming and Scripting | 2 | 01-29-2008 12:31 PM |
| Shell Script: want to insert values in database when update script runs | ring | Shell Programming and Scripting | 1 | 10-25-2007 12:06 AM |
| here document to automate perl script that call script | hogger84 | Shell Programming and Scripting | 3 | 10-22-2007 07:15 AM |
| returning to the parent shell after invoking a script within a script | gurukottur | Shell Programming and Scripting | 5 | 09-26-2006 04:05 AM |
| return valuse from child script to parent script | borncrazy | Shell Programming and Scripting | 1 | 08-20-2004 12:39 PM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
tar in a script
I am trying to write a simple script where I tar a few files and send them to tape
The code looks like this: tar -cvf archive/tam/*20080507* archive/sam/*20080507* source/delta/*20080507* This runs fine from the command line but when i try to run this in a script I get an end of tape error. Anyone know whats wrong ??? Thanks Zapper |
| Forum Sponsor | ||
|
|
|
#2
|
|||
|
|||
|
the syntax: is tar -cvf <destination like tape drive or tar file> <files to backup>
example: tar -cvf /dev/rmt/0 /etc /var # will backup /etc and /var to tape drive /dev/rmt/0 tar -cvf /tmp/ball.tar /etc /var # will backup /etc and /var to a file called /tmp/ball.tar what you are doing tar -cvf archive/tam/*20080507* archive/sam/*20080507* source/delta/*20080507* is being interpreted as trying to backup archive/sam/*20080507* & source/delta/*20080507* to a file called *20080507* inside archive/tam/ And maybe the error that's coming is not tape as it's not show you specified a tape device. Probably the error is trying to tell you that it's out of space. do a df -k and check the folder where "archive" located, I think it may be 100% full. the clean way to tar a few files from different location. example if I wanted to backup all the files under archive cd /archive ls -1 * > /tmp/xxx tar -cvf /dev/rmt/0 `cat /tmp/xxx` cd / |
|
#3
|
|||
|
|||
|
Ok thanks
So I am wondering why this works from the command line From what you are saying, I have to specify the tape drive if I am doing this from a script but from the command line it interprets the tape drive on its own somehow ?? Zapper |
|
#4
|
|||
|
|||
|
zapper222:
Could it be that you didn't specify "f" on the CLI? If so, then tar sends its o/p to the first tape drive by default. tar's behavior could be different on your platform, but this holds true for Solaris (/dev/rmt/0). |
|||
| Google The UNIX and Linux Forums |