Index: programs/mythbackend/housekeeper.cpp
===================================================================
--- programs/mythbackend/housekeeper.cpp	(revision 13461)
+++ programs/mythbackend/housekeeper.cpp	(working copy)
@@ -7,6 +7,7 @@
 #include <qstring.h>
 #include <qdatetime.h>
 #include <qstringlist.h>
+#include <qfileinfo.h>
 
 #include <iostream>
 using namespace std;
@@ -302,14 +303,61 @@
     QString mfarg = gContext->GetSetting("MythFillDatabaseArgs", "");
     QString mflog = gContext->GetSetting("MythFillDatabaseLog",
                                          "/var/log/mythfilldatabase.log");
+    bool logOutput = (!mflog.isEmpty());
 
     if (mfpath == "mythfilldatabase")
         mfpath = gContext->GetInstallPrefix() + "/bin/mythfilldatabase";
 
-    if (mflog == "")
+    if (logOutput)
+    {
+        QFileInfo testFile(mflog);
+        if (testFile.exists())
+        {
+            // If the file or directory is not writable, disable logging
+            if (!testFile.isWritable())
+            {
+                VERBOSE(VB_IMPORTANT,
+                        QString("Invalid mythfilldatabase log path: %1 "
+                                "is not writable.")
+                                .arg(mflog));
+                logOutput = false;
+            }
+            else if (testFile.isDir())
+            {
+                mflog.append("/mythfilldatabase.log");
+                // Although the directory is writable, the new filename may
+                // refer to an unwritable file
+                testFile.setFile(mflog);
+                if ((testFile.exists()) && (!testFile.isWritable()))
+                {
+                    VERBOSE(VB_IMPORTANT,
+                            QString("Invalid mythfilldatabase log path: %1 "
+                                    "is not writable.")
+                                    .arg(mflog));
+                    logOutput = false;
+                }
+            }
+        }
+        else
+        {
+            // The log file does not yet exist.  Verify the directory exists
+            // and is writable.
+            QString dir = testFile.dirPath();
+            testFile.setFile(dir);
+            if ((!testFile.exists()) || (!testFile.isWritable()))
+            {
+                VERBOSE(VB_IMPORTANT,
+                        QString("Invalid mythfilldatabase log path: %1")
+                                .arg(mflog));
+                logOutput = false;
+            }
+        }
+    }
+
+    if (logOutput)
+        command = QString("%1 %2 >>%3 2>&1").arg(mfpath).arg(mfarg).arg(mflog);
+    else
         command = QString("%1 %2").arg(mfpath).arg(mfarg);
-    else
-        command = QString("%1 %2 >>%3 2>&1").arg(mfpath).arg(mfarg).arg(mflog);
 
     myth_system(command.ascii(), MYTH_SYSTEM_DONT_BLOCK_LIRC | 
                                  MYTH_SYSTEM_DONT_BLOCK_JOYSTICK_MENU);
