Skip to content

Instantly share code, notes, and snippets.

@nodesocket
Last active December 14, 2015 01:49
Show Gist options
  • Save nodesocket/5009420 to your computer and use it in GitHub Desktop.
Save nodesocket/5009420 to your computer and use it in GitHub Desktop.
#!/bin/bash
# @description Sync a directory to s3
# @version 1.0.0
# @date last modified 02/21/2013
#
# Commando.io
# Copyright 2013 NodeSocket, LLC.
# All Rights Reserved.
if [ "$1" == "" ]; then
echo "ERROR: Missing required argument 'source directory'." >&2;
exit 1;
fi
source=${$1%%/}/
if [ "$2" == "" ]; then
echo "ERROR: Missing required argument 'bucket path'." >&2;
exit 1;
fi
bucket=${$2%%/}/
s3cmd sync --human-readable-sizes —-delete-removed --delete-after $source s3://$bucket
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment