migscabral / gdatacopier

Automatically exported from code.google.com/p/gdatacopier
0 stars 0 forks source link

Backup of multiple files with the same name #38

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I've a google docs account with many directories and subdirectories, in the
directories is quite easy to find many files with exactly the same name.

Using gdatacopier (just obtained through subversion) I obtain that:
a) gcp.py asks if overwrite or not the files with the same name;
b) using the "-o" option, the documents are overwritten.

Obviously both solutions are inadequate for a backup script.

The best solution would be to reproduce the gdocs directory tree, but an
acceptable solution would be also to include a switch to add the google
file identifier in the output filename.

Many thanks!

Original issue reported on code.google.com by gdaz...@gmail.com on 24 Oct 2009 at 1:47

GoogleCodeExporter commented 9 years ago
There's a partial solution to this in the development version, a -c option that 
creates subdirectories per 
owner of the document. This however still doesn't solve your issues where the 
same owner may have 
documents with the same name.

Replicating the directory structure doesn't help either as someone can have two 
documents with the same 
name in the same directory (its a possibility).

Previous versions of gcp did append the document_id to the name of the file but 
I had some users report 
issues like it had characters that were accepted in various OSes.

Let me think this through and see what I can come up with, will ensure that 
this is included in the 2.0.2 
release. Thanks for reporting it in.

Additionally can I request you to be a beta tester for this feature?

Original comment by devraj on 24 Oct 2009 at 11:41

GoogleCodeExporter commented 9 years ago
For a quick and dirty solution I've just modified the export_filename including 
also
the "entry.resourceId.text". This hack works correctly under linux (ext3 
filesystem)
but very likely, as you said, could give problems in other environments. 

Maybe it would be possible to use a simple hash function that maps the 
document_id to
a set of numerical-only values, in this way I think it would be possible to 
avoid any
OS concern.

I would be pleased to help as a beta tester.

Thanks again!

Original comment by gdaz...@gmail.com on 25 Oct 2009 at 7:09

GoogleCodeExporter commented 9 years ago
Added -i option to add a base64 encoded hash of the document id to the file 
name. Now available in the 
Subversion repository.

Please note this feature is still under testing and development

Original comment by devraj on 25 Oct 2009 at 10:26

GoogleCodeExporter commented 9 years ago
Base64 hash accepted as the proposed change.

Original comment by devraj on 29 Oct 2009 at 8:32