X-Git-Url: http://git.hcoop.net/clinton/scripts.git/blobdiff_plain/3b16fa867a36f38b2032b8f49c8725f6ac711418..8862af6d48b78cf6cf055dec506e02704dbf141c:/s3.common diff --git a/s3.common b/s3.common index 01a4497..f5f2361 100644 --- a/s3.common +++ b/s3.common @@ -1,3 +1,4 @@ +# -*- Shell-Script -*- # Common functions for dealing with Amazon S3. # units for BWLIMIT are KB/s @@ -34,19 +35,17 @@ function move_over () { # Expects the file to come from STDIN. # $1: date subdirectory # $2: filename - # $3: relative directory (optional) - if test -z "$2" || test -n "$4"; then + if test -z "$2" || test -n "$3"; then echo "Bad programming" exit 1 fi local subdir=$1 local file=$2 local dest=$BACKUPDIR/$subdir - if test -n "$2"; then - dest=$dest/$2 - fi + local ret split -d -b ${CHUNKSIZE}m - ${file}. for i in ${file}.*; do + echo "Transferring $i to S3 ..." s3_cmd put $dest/$i $i rm -f $i done