storagebox_upload
storagebox_upload zips up a folder of previously-downloaded content and uploads it via SFTP to an external "storage box" location (its is a general-purpose backup/delivery utility, not tied to the article-level pipeline structure).
Working
- It reads its own dedicated config file (default
config-test-storagebox-upload.json), looking up connection details and a source folder by two keys the caller passes in:userandcontent. - It then builds a zip of every file in the source folder that is not already recorded in a local CSV log (
log-upload_<user>.csv) as previously uploaded (i.e. it's incremental, only zipping/uploading new files since the last successful run). - Afterwards, it uploads the zip via
pysftp(host keys disabled) to the configured storage box. - Only after a successful upload does it append the newly-zipped filenames to the CSV log.
Other Important information about the module
- If the upload of a successfully packed zip file fails, the script, upon restart, creates a new zip file and it will try to upload the zip file again. I.e., the log file only logs successfully uploaded files, no interim steps.
userandcontentare arbitrary keys into its own config file, resolved independently of the rest of the pipeline's config format. This module can upload any folder, not just article data.