Upload amazon s3 melalui s3cmd di Ubuntu

Kebanyakan orang cuma tau upload ke Amazon S3 itu menggunakan
1. Amazon S3 account
2. Php S3 SDK
Nah, kali ini ogud mau share cara alternatif lain buat upload file ke S3, yaitu menggunakan s3cmd. Kedengerannya aga mirip-mirip cmd gitu ya, emang betul s3cmd ini menggunakan command line untuk upload ke S3, jadi biasanya dipakai untuk upload file yang ada di server ke S3. Saya kasi penjelasan yang mendasar aja nih tentang s3cmd.

Apa sih s3cmd ?

s3cmd adalah alat baris perintah untuk meng-upload, mengambil dan mengelola data di Amazon S3. Hal ini paling cocok untuk para line coder. s3cmd ini juga baik untuk backup data dll, s3cmd ini adalah sebuah proyek open source yang tersedia di bawah GNU Public License v2 (GPLv2) dan gratis untuk penggunaan komersial dan swasta.

Okay, kalau sudah mengerti apa itu s3cmd, kita lanjut kebagian step-step install s3cmd & cara menggunakan s3cmd ini.

Step 1

Install s3cmd

sudo apt-get install s3cmd

Step 2

Configure

sudo s3cmd --configure

Access key and Secret key Amazon S3
Access Key: (Access Key S3)
Secret Key: (Seccret Key S3)

Encryption password is used to protect your files from reading
by unauthorized persons while in transfer to S3
Encryption password: (your-password)
Path to GPG program [/usr/bin/gpg]:

When using secure HTTPS protocol all communication with Amazon S3
servers is protected from 3rd party eavesdropping. This method is
slower than plain HTTP and can’t be used if you’re behind a proxy
Use HTTPS protocol [No]:

On some networks all internet access must go through a HTTP proxy.
Try setting it here if you can’t conect to S3 directly
HTTP Proxy server name:

New settings:
Access Key: ***********************
Secret Key: ***************************
Encryption password: ***********
Path to GPG program: /usr/bin/gpg
Use HTTPS protocol: False
HTTP Proxy server name:
HTTP Proxy server port: 0

Test access with supplied credentials? [Y/n] y
Please wait…
Success. Your access key and secret key worked fine🙂

Now verifying that encryption works…
Success. Encryption and decryption worked fine🙂

Save settings? [y/N] y
Configuration saved to ‘/home/ubuntu/.s3cfg’

Step 3

Mengenal perintah-perintah yang ada di s3cmd

Listing Buckets:

s3cmd ls

Listing Bucket contents (folders):

s3cmd ls s3://Bucket-Name

Listing Bucket contents (files):

s3cmd ls s3://Bucket-Name/Folder-Name

Download all folder content:

s3cmd get s3://Bucket-Name/Folder-Name/*

Delete all folder content:

s3cmd del s3://Bucket-Name/Folder-Name/*

Jrenggg, beres dah. Akhirnya anda selesai kembali menginstall sesuatu di server anda dan mengenal semua perintah-perintah yang ada di s3cmd. Selamat ya😀

ref : http://blog.domenech.org/2012/10/using-aws-s3-with-s3cmd.html

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s