I have a cronjob that executes every minute that uses awscli s3 sync command for syncing my website with a S3 bucket.
It seems the command sometimes run for a very long time for no apparent reason :
20613 bitnami 20 0 191876 48668 9756 R 30.3 2.4 1:22.43 /usr/bin/python3 /home/bitnami/.local/bin/aws s3 sync --delete /opt/bitnami/apps/wordpress/htdocs s3://nutriti-code
In this example, the files are already synced as there is nothing new on the source to transfer to the S3 bucket.
I cannot see any log in the /var/log/syslog
except the confirmation that the command has executed successfully
Also my files are synced correctly.
Why would the command run for as long as 1m22s and more if there is nothing to sync ?
I am wondering why the command take so much time because there is nothing to sync and an S3 object will be downloaded if the size of the S3 object differs from the size of the local file, the last modified time of the S3 object is newer than the last modified time of the local file, or the S3 object does not exist in the local directory. The last modified time of the local file is changed to the last modified time of the S3 object.