The "2" is what I needed. I added it and the script now sends the error
messages to the file.

Regarding your gorgeous enhancements, I'm sure it would make a more
elegant script, but mine works as is now. More important, I can read
mine and understand what it does.

And yes, it pops up window asking if I want to run it or run it in a
terminal, so I have to click on "terminal." And then it asks me for my
password. But the terminal window automatically disappears when it
finishes, so I get a visual signal that it is done. I'm going to leave
well enough alone.

Thanks for the education!

On Sat, 27 Jun 2009 16:42:33 -0700
Rogan Creswick <[email protected]> dijo:

> standard out (general output) and standard error (error output) are
> treated differently.  To redirect stderr, you need to use 2>, instead
> of > Here's an example that should do what you want (note, untested!):
> 
> #!/bin/bash
> 
> RDIFF=rdiff-backup
> EXCLUDE_LIST=/home/jjj/rdiff_excludes.txt
> SOURCE=/
> DEST=/media/disk2/Full_system_backup
> ERR_OUT=/home/jjj/rdiff-errors.txt
> OUT=/home/jjj/rdiff-output.txt
> 
> STATS=/home/jjj/rdiff-stats.txt
> 
> $RDIFF --include-globbing-filelist $EXCLUDE_LIST $SOURCE $DEST 2>
> $ERR_OUT > $OUT
> $RDIFF --list-increment-sizes $DEST > $STATS
> 
> Note that you should be able to run this script with "sudo
> <scriptname>" rather than using sudu within the script (which may stop
> and ask for a password).
> 
> --Rogan
> 
> On Sat, Jun 27, 2009 at 4:16 PM, John Jason Jordan<[email protected]> wrote:
> > I'm sure this is trivial for most people here, but man bash is massive
> > and I can't figure it out.
> >
> > In an effort to bend rdiff-backup to my will I have created the
> > following script:
> >
> > #!/bin/bash
> > sudo rdiff-backup --include-globbing-filelist /home/jjj/rdiff_excludes.txt 
> > / /media/disk2/Full_system_backup > /home/jjj/rdiff-errors.txt
> > sudo rdiff-backup --list-increment-sizes /media/disk2/Full_system_backup > 
> > /home/jjj/rdiff-stats.txt
> >
> >
> > The first line runs the backup. The second line obtains statistics
> > about the backup.
> >
> > When running the backup several error messages are generated. I want
> > these saved to a file. I also want the statistics in the second line
> > written to a file.
> >
> > The statistics are going to the specified file perfectly. However, the
> > error messages generated when the backup is run are just being
> > displayed in a terminal window and not going to the file. When the
> > script ends the terminal window disappears. taking the error messages
> > with it. (I can see them if I watch while it is running.) The command
> > does create the rdiff-errors.txt file, but it has -0- bytes.
> >
> > The question is how to modify the "> /home/jjj/rdiff-errors.txt" part
> > of the first line so it sends the error messages to the file?
> > _______________________________________________
> > PLUG mailing list
> > [email protected]
> > http://lists.pdxlinux.org/mailman/listinfo/plug
> >
> _______________________________________________
> PLUG mailing list
> [email protected]
> http://lists.pdxlinux.org/mailman/listinfo/plug
_______________________________________________
PLUG mailing list
[email protected]
http://lists.pdxlinux.org/mailman/listinfo/plug

Reply via email to