Name
Data::Save::S3 - Zip some files to Amazon S3
Synopsis
The specified files are copied into a sub folder/zip, then moved into a zip file folder/zip.zip and uploaded to S3 using aws-cli optionally using a specified profile.
At the end of the process a copy of the files will exist in the local file: folder/zip.zip and in the S3 bucket. If you do not want to keep the locally zipped copy call method clean to unlink it and remove the containing folder if it is empty.
Required software
You should install the zip command and aws-cli before using this module.
Example
use Data::Save::S3;
my $z = Data::Save::S3::new;
$z->zip = qq(DataSaveS3);
$z->add = [filePathExt(currentDirectory, qw(test c)))];
$z->s3 = qq(bucket/folder);
$z->send;
produces:
cd zip && zip -mqrT DataSaveS3 DataSaveS3
aws s3 cp zip/DataSaveS3.zip s3://AppaAppsSourceVersions/DataSaveS3.zip
Completed 1.8 KiB/1.8 KiB (296 Bytes/s) with 1 file(s) remaining
upload: zip/DataSaveS3.zip to s3://AppaAppsSourceVersions/DataSaveS3.zip