s3cmd - Linux command line interface with Amazon S3 data storage

Loading...

Sign in or sign up now!
Alert icon
Upgrade to the latest Flash Player for improved playback performance. Upgrade now or more info.
1,527
Loading...
Alert icon
Sign in or sign up now!
Alert icon

Uploaded by on Nov 25, 2010

http://linuxbyexample.org

Backups! - sooner or later you are going to have to rely on your backups, to retrieve an important photograph or document that you have lost, and if your home or business premises is subjected to flood or fire damage, then your going to be thankful that those backups where off-site, accessible over the Internet.

There are many services that provide off-site storage solutions for your data, but I prefer to use the Amazon S3 service, as it's very affordable, and you just pay for the storage you use. To give you an example, I have over nine Gigabytes of family photographs and documents saved there, and it costs me around one dollar fifty a month, which is less then eighty pence for us in the UK. A small price to pay to ensure all my wedding and holiday photographs are backed up.

Amazon provides an nice web interface to their product, so you can see what files you have uploaded, retrieving them if necessary. If your just a home user, then using the file upload feature of the web application will probably meet your requirements. However, if your a business, then maybe you want to automate your backups at a scheduled time each night, so that all your data is compressed, and then auto uploaded to your Amazon S3 account. So I am going to show you how to use the command line tool, called s 3 command, which once installed and configured with your account credentials, will allow you to upload files as part of a backup script. (http://s3tools.org/s3cmd)

Below I show how to use the command, it's worth mentioning that if your concerned about Amazon employees accessing the files you upload, then simply use some form of encryption on your files before you upload them. In episode four, I showed you how to use the c crypt command to encrypt your files, so check out that video for some tips on command line encryption.

OK, the first thing we need to do is create a bucket, which is Amazon S3 speak for a folder, which will contain the files which we upload. The command for this is s 3 c m d, space mb, short for make bucket, followed by the bucket name you want to create. The bucket name needs to be unique across all users who use the Amazon S3 service, so using your web site name is a good choice.

We can list the contents of the remote bucket, by changing the mb parameter with ls, as you can see there are no files uploaded yet, so let's try uploading a file.

Here I have a JPEG photograph that I want to backup, the command parameter for this is put, followed by the file name you wish to upload, finally entering the bucket name you wish to store the file in. As the file is uploading, you are given a percentage readout, so you can gauge how long it will take to upload your files.

Once the file has been uploaded, we can re-run the listing command to verify that it is in fact there.

Let's now delete my local copy of the file by using the rm command. Oops! - didn't mean to do that. OK, let's restore the file from the remote backup. The command parameter to restore a file is get, followed by the full bucket name and file name to restore. There you go, it's one hundred percent done, let's just check, yep the file is there.

If you want to delete a file from the remote backup, you can use the del command parameter, followed by the full path to the file name you wish to delete.

As your charged for the storage you use, it's really useful to be able to find out how much storage all your backups are using. You can do this by using the du command parameter, which is short for disk usage, and if supplied with the dash H option, the output is displayed in a more human readable format, that being in Gigabyte totals. As you can see I am using nine Gigabytes at the moment.

Category:

Howto & Style

Tags:

License:

Standard YouTube License

  • likes, 0 dislikes

Link to this comment:

Share to:
see all

All Comments (2)

Sign In or Sign Up now to post a comment!
  • @lardconcepts

    Thanks for the comments, glad you liked the video, and thanks for subscribing.

    Paul.

  • This is good - clear, HD, good voice. ... subscribed!

Loading...
Alert icon
0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more