Resuming and Overwriting
If a FASP transfer is interrupted, be it by an error or because -[session stop] was called, it is possible to continue the same transfer by calling [session start] again. Depending on the exact combination of parameters used for the session the continued transfer may behave in several ways with respect to already and partially transferred files. Common behaviors include:
- it may pick up from where it left off and transfer only the remaining data for partially transferred files and files that have not yet been transferred. This is the default behavior
- it may start transferring all files from the beginning (including those that have been partially or fully transferred)
- it may transfer only files that have not been fully or partially transferred before. The parameters that control this behavior are the resume policy and the overwrite policy. The default behavior corresponds to the default values of
ASResumePolicySparseCsum
andASOverwritePolicyDiff
.
The overwrite and resume policies are only relevant when a file in a session is already present at the destination. First the overwrite policy is evaluated with respect to the file that is present at the destination in order to determine if FASP may or should write to the file. If FASP may not write to the file then the file is skipped and no bytes from this file will be transferred (in this case the resume policy is not evaluated). If on the other hand FASP may write to the file it then evaluates the resume policy to determine if it should transfer the file in its entirety, only part of the file or if the file is already complete and no bytes need transferring.
The available overwrite policies are:
ASOverwritePolicyNever
: never allow writing to files that are already present at the destination, they will simply be skipped. The resume policy is not evaluated.ASOverwritePolicyAlways
: always write to files at the destination. The resume policy is not evaluated and files are always transferred in their entirety even if fully present at the destination.ASOverwritePolicyDiff
: allow writing to a file at the destination even if it is present. The resume policy will be evaluated to decide whether to transfer part or all of the file.ASOverwritePolicyOlder
: write to a file if the file at the destination is older than the file at the source, otherwise the file is skipped. If the file at the destination is older the file is transferred in its entirety. The resume policy is not evaluated.
The available resume policies are:
ASResumePolicyNone
: never resume files. A file is always transferred in its entirety even if already partially present on the server.ASResumePolicyAttrs
: a file is resumed if its attributes at the destination match those at the source. Otherwise the file is transferred in its entirety.ASResumePolicySparseCsum
: a file is resumed if its attributes at the destination match those at the source and if a sparse checksum of the data already transferred at the destination matches that at the source. Otherwise the file is transferred in its entirety.ASResumePolicyFullCsum
: a file is resumed if its attributes at the destination match those at the source and if a full checksum of the data already transferred at the destination matches that at the source. Otherwise the file is transferred in its entirety.
For example, in order to achieve the second behavior listed at the top of this page one would set the overwrite policy to ASOverwritePolicyAlways
, whereas in order to achieve the third behavior one would set the overwrite policy to ASOverwritePolicyNever
. Note that in order for a file to be resumed on a second try it must have been initially transferred with a resume policy that allows resuming.