开发者

executing s3cmd using PHP exec()

I'm writing a mysql backup script which does a database backup and upload the backup into amazon s3 bucket.

I'm using exec() to run mysqldump, tar & gzip the backup. so far it was pretty straightforward. Now I have some issues with uploading the backup to amazon S3.

As far as I read, s3cmd requires a .s3cfg file with amazon's access_key & secret_key credentials. I don't want to rely on these settings in a separated config file, and I already have the amazon credentials in a PHP config file.

Is there a way to execute s3cmd and directly entering the keys into the command line? Something like:

s3cmd cp --access=KEY -secret=KEY /tmp/backup.tar.gz s3://backups/.... 

I don't want use the Zend_Cloud_StorageService_Adapter_S3. I understand this library has to read the enti开发者_运维技巧re file into the PHP memory and then send it. These backups will be huge and I prefer using exec(), which is much faster.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜