![]() ![]() The tutorial's example backup_script will backup up a small test_source directory.Ĭreate and populate the test_source directory: $ mkdir test_source More about Google Cloud Storage encryption is at: The main advantage of server side encryption is that it is simple to set up.Ĭlient side encryption increases complexity and is beyond the scope of this tutorial. bashrc Documents/f.txt Documents/f.exe Documents/f.txtĭisplay the test_source directory: $ tree -a -dirsfirstīy the end of the tutorial the test_source directory will look like this. Get a google account if you don't already have one.Ĭreate a Cloud Platform Console project on Set up Google Cloud project and install gsutil Lifecycle_config.json and backup_script files are at the end of this page. If it is not already installed, install Python 2.7 Gsutil is a Python application that accesses Google Cloud Storage from the command line.įollow the "Install gsutil" instructions on I'll use "backup-proj-140016" for the remainder of this tutorial. (The preceding instructions were modified from ) Create a bucketĪ bucket is the basic container used to store files. The bucket is located in a US data center and the bucket's name is "wolfv-backup-tutorial": $ gsutil mb -c nearline -l US -p backup-proj-140016 gs://wolfv-backup-tutorial The following gsutil command makes a bucket of the "Nearline" storage class. Of course you will have to modify the parameters for your situation.Īll bucket names share the global name space across all of Google Cloud. You will need to choose your own, unique, bucket name. List the files in the bucket: $ gsutil ls -l gs://wolfv-backup-tutorialĪlternatively, the bucket can be created and viewed from the Cloud Platform Console Browser. ![]() Object versioning allows you to restore objects if you accidentally delete them. It is turned on or off at the bucket level. If versioning is turned off, uploading to an existing object overwrites the current version.Įnable object versioning in your bucket: $ gsutil versioning set on gs://wolfv-backup-tutorial If versioning is turned on, uploading to an existing object creates a new version. Gsutil versioning command is documented at. Time to Live (TTL) automatically deletes older versions of objects. TTL is turned on or off at the bucket level. In a bucket with versioning enabled, deleting a live object creates an archived object ĭeleting an archived object deletes the object permanently. Typical backup lifecyles are in months or years. The following example uses very short lifecycles and small numNewerVersions so you can see the effects of conditions in a day. There may be a lag between when the conditions are satisfied and when the object is deleted.Įxample test_source/lifecycle_config.json: It will delete a archive version of a file if there are 2 newer versions, or if the version is more than a day old. Gsutil lifecycle command is documented at. Give yourself permission to execute the script: $ chmod u+x backup_script Create backup scriptĬopy the 4_backup_script file to your test_source directory and rename it backup_script. The backup_script takes two arguments: SOURCE - will be the test_source directory.ĭESTINATION - will be the gs://wolfv-backup-tutorial bucket. The backup_script uses gsutil rsync to synchronize DESTINATION to SOURCE. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |