Steve's Python Utils - New Repo

An assortment of python [shell] scripts for various minor tasks.  In this case an assortment starts with one.

The GitHub repo is here: steves-python-utils

My first addition is a synchronization script, called, I use to sync a local folder/directory with one on Amazon Web Services S3.


Given a local directory and a S3 bucket and remote subdirectory.  It compares the local files, including subdirectories, corresponding to S3.  If a new file appears within the local subdirectory it is uploaded.  Also, if a timestamp indicating modification to a local file where the date/time is out of sync with its S3 counterpart, the file is also uploading overwriting the S3 copy of it.

Because of possible timezone differences between the local computer and S3, the script takes a timezone difference as a parameter (in hours).

Example usage:

python -4 ~/wp/wp-content/uploads/ uploads


-4 is the timezone difference from GMT in this case.  So the server this is being run on is in Atlantic Time.

~/wp/wp-content/uploads/ is the local file path

uploads is the remote path on S3.

Note: the S3 security credentials and bucket name are specified within

The underlying S3 calls are done through the python boto package.

My current use of this is to trigger a synchronization of Wordpress Media uploads to S3.


I have a few other python scripts kicking around that I will eventually sanitize for public consumption in the steves-python-utils GitHub repository.

Leave a Comment

Permitted HTML tags in your comment: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>