This is what I have so far (it's a fixed backup destination currently, which has to be changed). Unfortunately the resulting backup files are always empty -- which confuses me, because writeStory() uses the data presumably contained within to check if the EPUB should be updated in the first place? Or maybe it's only applicable to the CLI version and Calibre's Plugin API always creates an empty target file?