![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Shell script answer prompts? | eltinator | Shell Programming and Scripting | 4 | 08-29-2007 12:15 PM |
| pkgadd pkgask still prompts for user input | prkfriryce | SUN Solaris | 1 | 06-28-2007 01:27 PM |
| run a application from a remote server via script? | yankee428 | Shell Programming and Scripting | 4 | 10-26-2005 05:11 PM |
| Script to Test Application Server is running | duglover | UNIX for Dummies Questions & Answers | 0 | 04-28-2004 10:47 AM |
| Providing a Link to Perl | brahill | UNIX for Dummies Questions & Answers | 4 | 10-10-2000 09:37 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
script providing input to application prompts
Hi!
I want to write a script that will create an archive (via tar) that will restrict the size of the tar file. The size can be constrained using the keyword 'k' and providing the size restriction. The problem is that the script needs to know (detect) when the tar command prompts the user (which will be this script) so that the script can copy the tar file to a temporary file (like tarFileName.1) and then return control back to the tar command to create the next volume. (hope you could follow that logic) My problem is I know of no mechanism in scripting in unix that allows for this kind of command flow control. Does it exist? Can anyone suggest a method I can use for this? (interrupt handlers; subs; ....) tia, mitch ps the reason for needing to limit the size is to allow a customer to ftp some huge subdirectories (>10Gb) in bitesize pieces. The script will first gzip all the files, then archive them into volumes of, say, 100Mb in size. But the tar command prompts the user to change the archive media and hit RETURN to continue. The operator needs to copy the tar file to some other file, then hit return for this method to work. |
|
||||
|
You can do it in much simpler way in three steps:
1. Create the full archive file xxx.tar.gz or xxx.tar. 2. split -b <size> xxx.tar.gz where <size> is the size of single piece. 3. mv xaa xxx_1.tar.gz mv xab xxx_2.tar.gz ................................. In order to reassable the pieces togather again cat xxx_1.tar.gz xxx_2.tar.gz ..... xxx_N.tar.gz > myarchive.tar.gz |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|