Closed dlenski closed 9 years ago
Glad you find it useful Dan, and thanks for the improvements! Great contributions and the code looks solid. I'll merge your pull request. The only issue that I can see, is that there are cases, such as when you've created an activity manually, where it isn't possible to export the .FIT file for the activity (since it doesn't have one). In such cases, the incremental backup will try to back up all those activities with missing .FIT files again, which, in my case, were quite a few. Maybe that could be solved just by writing some empty placeholder file for missing .FIT files.
Anyhow.. Thanks a bunch for the contributions! I'm merging them in!
Oh, and by the way, I'm considering dropping the garminexport.py script altogether, since incremental_backup.py practically does the same thing, with some additional cleverness.
I guess you wouldn't mind that?
Thanks!
The only issue that I can see, is that there are cases, such as when you've created an activity manually, where it isn't possible to export the .FIT file for the activity (since it doesn't have one). In such cases, the incremental backup will try to back up all those activities with missing .FIT files again, which, in my case, were quite a few. Maybe that could be solved just by writing some empty placeholder file for missing .FIT files.
Good point, I hadn't thought of this. When you do the activity search, you're actually getting the whole activitySummary
structure (I think) so it should be possible to pre-identify activities which were manually created and won't ever generate certain file types.
I can work on a patch for that...
I'm considering dropping the garminexport.py script altogether, since incremental_backup.py practically does the same thing, with some additional cleverness I guess you wouldn't mind that?
Not at all. Makes sense to consolidate them in this way.
Great utility! I added a few features which others may find useful too.
garminexport
andincremental_backup
:-E
to ignore errors in backing up individual activities (I'm getting sporadic500 Server Error
for some reason)-f
to limit exported formats to a subset (e.g.-f tcx -f json_summary
)incremental_backup
can export only a subset of formats, it needs to be more intellligent about figuring out which activities need to be re-fetched. For example, with-f tcx -f json_summary
it should check that both of those exist for a given activity. In order to make this work, I modifiedlist_activity_ids
(renamed tolist_activities
) to return both the starting timestamp and the activity ID in order to determine the expected filenames for each activity.