On Friday 28 October 2005 10:59, Martin Simmons wrote:
> >>>>> On Fri, 28 Oct 2005 08:28:31 +0700, "frank" <[EMAIL PROTECTED]> said:
>
> frank> I cannot get MySQL fifo backups to work. If I run the
> frank> backup job it hangs forever waiting for the input. If I
> frank> run the job manually from the shell it works without
> frank> problems. What is going on?
>
> frank> ...
>
> frank> #!/bin/sh
>
> frank> database=mydb
> frank> user=root
> frank> password="***"
> frank> fifo=/backup/fifo/MyDatabase
>
> frank> case "$1" in
> frank> before)
> frank> echo Before backup job processing...
> frank> rm -f $fifo 2>&1 < /dev/null
> frank> mkfifo $fifo 2>&1 < /dev/null
> frank> echo Dumping $database to fifo: $fifo
> frank> mysqldump --user=$user --password=$password $database & >
> $fifo 2>&1 < /dev/null frank> echo Done.
> frank> ;;
> frank> after)
> frank> echo After backup job processing...
> frank> rm -f $fifo 2>&1 < /dev/null
> frank> echo Done.
> frank> ;;
> frank> esac
>
> Is the mysqldump process still there when the job is hanging?
>
> What happens if you remove 2>&1? I don't see the point in redirecting
> stderr to the fifo anyway, but also it will hide any error messages on the
> tape :-)
In addition, I don't see any need to redirect /dev/null to the input for rm,
mkfifo, and mysqldump. It probably won't hurt anything, but it just
complicates understanding what is really going on. A cleaner script would
be:
#!/bin/sh
database=mydb
user=root
password="***"
fifo=/backup/fifo/MyDatabase
case "$1" in
before)
echo "Before backup job processing..."
rm -f $fifo
mkfifo $fifo
echo "Dumping $database to fifo: $fifo"
mysqldump --user=$user --password=$password $database > $fifo &
echo "Done."
;;
after)
echo "After backup job processing..."
rm -f $fifo
echo "Done."
;;
esac
>
> __Martin
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by the JBoss Inc.
> Get Certified Today * Register for a JBoss Training Course
> Free Certification Exam for All Training Attendees Through End of 2005
> Visit http://www.jboss.com/services/certification for more information
> _______________________________________________
> Bacula-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/bacula-users
--
Best regards,
Kern
(">
/\
V_V
-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course
Free Certification Exam for All Training Attendees Through End of 2005
Visit http://www.jboss.com/services/certification for more information
_______________________________________________
Bacula-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bacula-users