Old backups are not deleted on Google Drive

Bug #1306242 reported by Nichlas
58
This bug affects 11 people
Affects Status Importance Assigned to Milestone
Duplicity
Confirmed
Medium
Unassigned

Bug Description

I use version 0.6.23 and backup my files to Google Drive with the gdocs command.

My problem is that duplicity don't delete old full backups when i ask it to cleanup.

Instead all the files end up as files with no category/folder, and are still taking up a lot of space - and because there are a large number of files it is not trivial to find them and delete them (this is mostly Google's fault, as it is hard to finde files with no folder, that also don't belong in the top folder).

The only other mention i found about this was this mail on the mailing list: https://lists.nongnu.org/archive/html/duplicity-talk/2013-03/msg00024.html that sadly never got any answer.

Tags: gdocs
Revision history for this message
Stefan Seidel (seidler2547) wrote :

I have found out the root cause and a fix for this. It only happens when you are backing up into a Google Drive "folder", i.e. not the root collection of Drive. When this is being done, the "delete" action of the gdata api only removes the file from the collection, not from drive, so the file ends up in the root collection instead of being deleted.

The solution is to delete the file by its resource_id, so in gdocsbackend inside the delete function, instead of
> self.client.delete(entry.get_edit_link().href + '?delete=true', force=True)
it needs to read
> self.client.delete(self.client.get_doc(entry.resource_id.text).get_edit_link().href + '?delete=true', force=True)

I have tested and verified that this works with 0.6.18 on Ubuntu 12.04.

Revision history for this message
Fjodor (sune-molgaard) wrote :

The edit in #1 didn't work for me, but the following did, in the two places where it is present:

self.client.delete(self.client.get_ressource(entry).get_edit_link().href + '?delete=true', force=True)

Revision history for this message
Fjodor (sune-molgaard) wrote :

Strike that!

What worked was:

self.client.delete(self.client.get_resource_by_id(entry.resource_id.text).get_edit_link().href + '?delete=true', force=True)

get_doc is apparently missing from later versions of the python libs

Revision history for this message
Fjodor (sune-molgaard) wrote :

Could anyone, perchance, ship this upstream for 6.25, and then package that when it comes, since you guys haven't really replied nor gotten around to package 6.24?

Changed in duplicity:
status: New → Confirmed
importance: Undecided → Medium
Revision history for this message
Kenneth Loafman (kenneth-loafman) wrote :

https://bugs.launchpad.net/duplicity/+bug/1315684 will probably fix this, so work it first.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.