Last active
December 14, 2015 01:49
-
-
Save nodesocket/5009420 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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