How to specify files for exclusion?

Asked by Sagar Behere

I am trying to specify which files should be excluded from backups. I proceeded as follows (Time Drive v 0.4, Ubuntu 10.04 amd64, installed from ppa):

0. Under Settings, in the Exclude tab, I clicked on the Add button
1. In the popup dialog, I tried entering various regular expressions, for example

.* [to exclude all hidden files]
*~ [to exclude all files ending in ~]

and various other regexs that work fine with rsync, for example.

However, no matter what I enter, when I press 'Ok', I get the an error dialog with the message
"Error regular expressions"

Am I doing something wrong?

Thanks in advance,
Sagar

Question information

Language:
English Edit question
Status:
Answered
For:
Time Drive Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
clee (chris-leemesser) said :
#1

There is a typo in the 0.4 version of time-drive in timedrive/settingsdialog.py about on line68

if not self._Validate.check(self.Validate.REGEX, excludePattern):

needs to be
if not self._Validate.check(self._Validate.REGEX, excludePattern):

The try/except around this portion was masking the syntax error.

Here is a potential patch.

--- a/timedrive/settingsdialog.py Tue Jul 12 08:24:03 2011 -0700
+++ b/timedrive/settingsdialog.py Tue Jul 12 08:01:08 2011 -0700
@@ -65,15 +65,11 @@
     if excludePattern == None:
      return e

- if not self._Validate.check(self._Validate.REGEX, excludePattern):
+ if not self._Validate.check(self.Validate.REGEX, excludePattern):
      QtGui.QMessageBox.warning(self, _("Invalid"), _("Invalid regular expressions"))

     e = excludeitem.ExcludeItem(excludePattern, excludeType)
    except:
- import traceback, sys
- tp, val, tb = sys.exc_info()
- traceback.print_exception(tp,val,tb)
-
     QtGui.QMessageBox.warning(self, _("Exception"), _("Error regular expressions"))

   elif excludeType == excludeitem.ExcludeItem.FOLDER:
@@ -81,4 +77,4 @@
   elif excludeType == excludeitem.ExcludeItem.FILE:
    e = excludeitem.ExcludeItem(excludePattern, excludeType)

- return e
+ return e
\ No newline at end of file

Can you help with this problem?

Provide an answer of your own, or ask Sagar Behere for more information if necessary.

To post a message you must log in.