The Upload Process in Detail
Upload Steps
- Create an empty
upload-meta.json
for new upload processes and upload it to the server - Download the
upload-meta.json
from the server if the upload has been started before but interrupted - When files are found in the
fileList
that do not exist locally: raise an exception - When the remote meta says
complete=True
but there are local files not infileList
: raise an exception - For every file that is found locally but not in the server side meta, upload it with
scp
- Every 25 files - for performance reasons - update the server-side meta-file
- Upload the file
/scripts/get_upload_dir_checksum.py
to the server and calculate the checksum of theYYYYMMDD
directory on the server (based onfileList
). - Calculate the local checksum using the same script
- When both checksums match, set
complete=True
in the remote meta and possibly remove the localYYYYMMDD
directory
Causes for an InvalidUploadState
exception
Whenever the upload encounters an invalid state, it raises an InvalidUploadState
exception, which appears in the logs and continues with the following YYYYMMDD
directory. Possible causes are:
- The upload thread crashed during the removal of the local
YYYYMMDD
directory - Files to the local
YYYYMMDD
directory were added after that day - Files from the local
YYYYMMDD
directory were removed manually - The remote meta file was manipulated by hand