Thursday 2 May 2013

Installing s3cmd for S3 backup on Amazon


Find the lalest s3cmd package, i am using s3cmd-1.5.0-alpha1.tar.gz
http://sourceforge.net/projects/s3tools/files/s3cmd/
login as: root
[root@localhost opt]#wget http://sourceforge.net/projects/s3tools/files/s3cmd/s3cmd-1.5.0-alpha1.tar.gz
[root@localhost opt]# tar xvzf s3cmd-1.5.0-alpha1.tar.gz
[root@localhost opt]# ls
s3cmd-1.5.0-alpha1
s3cmd-1.5.0-alpha1.tar.gz
[root@localhost opt]# mv s3cmd-1.5.0-alpha1 s3cmd
[root@localhost opt]# ls
s3cmd
s3cmd-1.5.0-alpha1.tar.gz
[root@localhost opt]# cd s3cmd
[root@localhost s3cmd]# ls
INSTALL  NEWS  PKG-INFO  README  S3  s3cmd  s3cmd.1  setup.cfg  setup.py
[root@localhost s3cmd]# python setup.py install
[root@localhost ~]#s3cmd –help    ( help command)

Configure s3cmd:
[root@localhost ~]# s3cmd –configure
Enter new values or accept defaults in brackets with Enter.
Refer to user manual for detailed description of all options.
Access key and Secret key are your identifiers for Amazon S3
Access Key: ****************  (entry access key generated by Amazon)
Secret Key: ******************  (enter Secret key generated by Amazon)
Encryption password is used to protect your files from reading
by unauthorized persons while in transfer to S3
Encryption 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, attempting to list all buckets…
Success. Your access key and secret key worked fine 
Now verifying that encryption works…
Not configured. Never mind.
Save settings? [y/N] y
Configuration saved to ‘/root/.s3cfg’
[root@localhost ~]#s3cmd ls    (list your Amazon S3 buckets)

User this command for S3 sync :
s3cmd sync --delete-removed /opt/abc/* s3://buketname


Create automating backup on Amazon S3 with Windows
Download tools below link
https://sites.google.com/site/jitbit/files/S3Sync.zip?attredirects=0&d=1

Extract and put folder where you want : In my case

D:\S3Sync

and run this command

S3Sync.exe -AWSAccessKeyId XXXXXXX -AWSSecretAccessKey XXXXXXXXX -SyncDirection upload -LocalFolderPath "D:\abc" -BucketName BUCKETNAME


First XXXXXXXX put here access key , second XXXXXXXX put here Secret Key, third change file location with D:\abc , forth change Bucket name with BUCKETNAME.

and create bat file  like s3rsync.bat make entry below the same
cd \
cd D:\S3Sync
d:
@ECHO OFF
 CLS
S3Sync.exe -AWSAccessKeyId XXXXXXX -AWSSecretAccessKey XXXXXXXXX -SyncDirection upload -LocalFolderPath "D:\abc" -BucketName BUCKETNAME
ENDLOCAL


save and Task Scheduler according to requirement :






 

No comments:

Post a Comment

Install XRDP in Centos 7

rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm yum update yum groupinstall "GNOME Desktop" ...