Currently my parents back in Pennsylvania operate a tax preparation service. Being the only tech literate person in the family the management of there computers falls to me. One of the problems that I had to fix was a lack of backups. To protect against a single drive failure we could easily backup the data to an external hard drive but for a better disaster recovery we needed off site backups.
Being an S3 employee I thought it made sense to back up the data to S3. To ensure that the data was encrypted I decided to create a python script that could encrypt the files using a gpg key and then upload the encrypted files to an S3 bucket.
The current version of the code is availble on github. The code currently only supports previous years of the Drake Tax Software. Versions post 2016 migrated to a new backup system within the software that 7zips the files.
One note on the S3 upload.
s3_client.Object(bucket_name=S3_BUCKET_NAME, key=key).put(Body=ef, StorageClass='STANDARD_IA')
I chose to use STANDARD_IA, I did the math and confirmed that as long as the data doesn't have to be retrieved the cost is cheaper than STANDARD. I also set a lifecycle policy to expire the objects after 90 days. these are backups so I hope I never need them.