14

How would I delete all recurring tasks in taskwarrior, which are completed, till some date?

I tried:

task Nevena until:07/29/2014 uuids

to get listed those that fall before that date, and collect their id's, so I could pipe them to delete command, but I did not get expected results.

Slava Semushin
  • 13,753
  • 7
  • 47
  • 66
branquito
  • 3,276
  • 4
  • 28
  • 54

3 Answers3

9

I found answer, after pulling my hair for a while (WARNING: This command might also delete tasks which are not recurring):

task $(task uuids due.before:now) delete

did the trick.

This worked, because no matter what the date was, completed tasks had no due date in future, so this command left intact my current fresh tasks with due dates.

Tom Dörr
  • 424
  • 4
  • 14
branquito
  • 3,276
  • 4
  • 28
  • 54
9

I believe the answer is to delete the parent tasks and then the recurring tasks will no longer get created. You can show all parent tasks with task all +PARENT. For example:

$ task all +PARENT

ID St UUID     Age  Done Tags R Due        Until Description                                     
21 R  58e83c9b 1.7y           R 2018-04-01       replace upstairs air filter                     
20 R  f8b5b0db 1.7y       [1] R 2018-04-01       replace upstairs air filter

I somehow had two recurring tasks for the same thing. I can delete them:

$ task delete 21 
Delete task 21 'replace upstairs air filter'? (yes/no) yes
Deleting task 21 'replace upstairs air filter'.
Deleted 1 task.
$
$ task delete 20
Delete task 20 'replace upstairs air filter'? (yes/no) yes
Deleting task 20 'replace upstairs air filter'.
Deleted 1 task.

Now the recurring tasks shouldn't show up any longer.

dustymabe
  • 356
  • 4
  • 5
0

The command

task $(task uuids due.before:now +CHILD +COMPLETED) delete

should do exactly what you want.

Based on the answer by @branquito.

Tom Dörr
  • 424
  • 4
  • 14