begin quoting Brad Beyenhof as of Mon, Mar 31, 2008 at 09:32:06AM -0700:
> So I've got a bash script (run as a cron job) that currently runs tar
> and redirects stdout and stderr to particular files.
>
> I'd like to run the tar command through screen so that I can check in
> on the process; also, the archive now spans two tapes, so using screen
> will hold the process so I can swap manually and respond interactively
> to tar's request for a new tape. To do this, I first tried just
> prepending screen to the existing command:
>
> /usr/bin/screen -dm tar [options] 2>{$file1} | tee {$file2}
>
> Unfortunately, that doesn't work. Screen seems to initiate a new
[chop]
> Ideas, anyone?
Dump the invocation into a script, then invoke the script in screen.
$ cat target
#!/bin/sh
tar [options] 2>$file1 | tee $file2
$ screen -dm ./target
--
Otherwise, look at single-quotes and backslashes.
Stewart Stremler
--
[email protected]
http://www.kernel-panic.org/cgi-bin/mailman/listinfo/kplug-list