miércoles, 7 de diciembre de 2011

AWS Management Console Amazon S3 en debian Squeeze

Descargamos el AWS:

root@Debian:~# wget https://raw.github.com/timkay/aws/master/aws


Damos permisos de ejecucion:

root@Debian:~# chmod a+x aws


Ejecutamos:

root@Debian:~# ./aws
sanity-check: "/root/.awssecret": file is missing. (Format: AccessKeyID\nSeecretAccessKey\n)
sanity-check: This curl (v) does not support --retry (>= v7.12.3), so --retry is disabled
sanity-check: Problems accessing AWS. Is curl installed?


Nos dice que necesitamos Curl, lo instalamos:

root@Debian:~# apt-get install curl

Do you want to continue [Y/n]? Y

sanity-check: "/root/.awssecret": file is missing. (Format: AccessKeyID\nSeecretAccessKey\n)
sanity-check: Your system clock is 22 seconds behind.


Creamos un archivo donde pondremos el access y la secret:

root@Debian:~# vim /root/.awssecret
AIOCQODIYUFAYAOISE # Reemplazarlo por nuestro access
J3XliKAASDBZgOoq0wu21GQqhwHI4t71GwphaqW # Reemplazarlo por nuestra secret


Volvemos a ejecutarlo:

root@Debian:~# ./aws
sanity-check: "/root/.awssecret": file permissions are -rw-r--r--. Should be -rw-------


Debemos modificar los permisos del awssecret:

root@Debian:~# ls -l "/root/.awssecret"
-rw-r--r-- 1 root root 62 Dec 6 17:46 /root/.awssecret

root@Debian:~# chmod 600 /root/.awssecret


Listamos los Buckets:

root@Debian:~# ./aws ls
sanity-check: Your system clock is 22 seconds behind.
+-------------------+--------------------------+
| Name | CreationDate
+-------------------+--------------------------+
| Backet | 2011-12-06T15:35:34.00
+-------------------+--------------------------+


Listamos un bucket en particular, vemos que dentro tenemos un file prueba.txt:

root@Debian:~# ./aws ls Bucket
sanity-check: Your system clock is 7 seconds ahead.
+-------------------+--------+--------+---------+-------------+------------+---------
| Name | Prefix | Marker | MaxKeys | IsTruncated | Key | LastModified | Size | StorageClass |
+-------------------+--------+--------+---------+-------------+------------+---------
| Bucket | | | 1000 | false |
| | | | | | prueba.txt | 2011-12-07T17:08:54.000Z | 12 | STANDARD |
+-------------------+--------+--------+---------+-------------+------------+---------


Subimos un archivo:

root@Debian:~# ./aws put Bucket otro.txt


Listamos:

root@Debian:~# ./aws ls Bucket
sanity-check: Your system clock is 8 seconds ahead.
+-------------------+--------+--------+---------+-------------+------------+---------
| Name | Prefix | Marker | MaxKeys | IsTruncated | Key | LastModified | Size | StorageClass |
+-------------------+--------+--------+---------+-------------+------------+---------
| Bucket | | | 1000 | false | | | | |
| | | | | | otro.txt | 2011-12-07T18:27:49.000Z | 5 | STANDARD |
| | | | | | prueba.txt | 2011-12-07T17:08:54.000Z | 12 | STANDARD |
+-------------------+--------+--------+---------+-------------+------------+---------


Descargamos un archivo:

root@Debian:~# ./aws get BackupRatingCorpo/\otro.txt nuevillo.txt
sanity-check: Your system clock is 8 seconds ahead.

No hay comentarios: