datapipeline.ymlaws s3 sync: if return code is 2, then return 0 for the pipeline to succeed
Why
Some applications (e.g.Jenkins) use symlinks that point to non-existing locations. aws s3 sync skips them and returns status code 2. Status code 2 is just a warning, but DataPipeline considers it an error resulting in the backup status Failed
warning: Skipping file /backup/jobs/WWWWW/builds/lastSuccessfulBuild. File does not exist. warning: Skipping file /backup/jobs/WWWWW/builds/lastUnstableBuild. File does not exist. warning: Skipping file /backup/jobs/WWWWW/builds/lastFailedBuild. File does not exist. warning: Skipping file /backup/jobs/WWWWW/builds/lastUnsuccessfulBuild. File does not exist. warning: Skipping file /backup/jobs/WWWWW/builds/lastStableBuild. File does not exist.
Return code 2 can mean at least one or more files marked for transfer were skipped during the transfer process. However, all other files marked for transfer were successfully transferred. Files that are skipped during the transfer process include: files that do not exist, files that are character special devices, block special device, FIFO's, or sockets, and files that the user cannot read from.
What
datapipeline.yml
aws s3 sync
: if return code is 2, then return 0 for the pipeline to succeedWhy
Jenkins
) use symlinks that point to non-existing locations.aws s3 sync
skips them and returns status code2
. Status code2
is just a warning, butDataPipeline
considers it an error resulting in the backup statusFailed
References