Donate Share

AutoMySQLBackup

Tracker: Bugs

5 Clean up IO redirection - ID: 1869133
Last Update: Tracker Item Submitted ( subpixel )

Existing code in automysqlbackup.sh.2.5 to set up and restore redirection
of stdout and stderr...

--------------------------

# IO redirection for logging.
touch $LOGFILE
exec 6>&1 # Link file descriptor #6 with stdout.
# Saves stdout.
exec > $LOGFILE # stdout replaced with file $LOGFILE.
touch $LOGERR
exec 7>&2 # Link file descriptor #7 with stderr.
# Saves stderr.
exec 2> $LOGERR # stderr replaced with file $LOGERR.

--------------------------

#Clean up IO redirection
exec 1>&6 6>&- # Restore stdout and close file descriptor #6.
exec 1>&7 7>&- # Restore stdout and close file descriptor #7.

--------------------------

The last line looks like a "cut & paste code" error.

I'm supposing the intention is to restore stderr, and should be

exec 2>&7 7>&- # Restore stderr and close file descriptor #7.

Mind you, I've never run this script (in any form), so please consider the
implications for yourself before making any changes!

-spxl


subpixel ( subpixel ) - 2008-01-11 09:34

5

Open

None

Nobody/Anonymous

None

None

Public


Comments




Log in to comment.

No follow-up comments have been posted.

Attached File

No Files Currently Attached

Change

No changes have been made to this artifact.