Package: c2.recipe.bkups3
RequirementPlonePlone 4.0 (tested by 4.0.4 on MacOS 10.6)Support SSL in Python (If your backup destination is AWS-S3)Amazon web service account(If your backup destination is AWS-S3)Amazon web service account (aws access key / aws secret key)S3 root bucket nameInformationCode repository:https://bitbucket.org/cmscom/c2.recipe.bkups3Questions and comments toterada@cmscom.jpReport bugs athttps://bitbucket.org/cmscom/c2.recipe.bkups3/issuesReferred tohttp://pypi.python.org/pypi/collective.recipe.backupNoteIf you don’t haverepozocommand in bin folder, you need to add the lines inbuildout.cfg.  The following lines will createbin/buckupscript witch this recipe is using.buildout.cfg[repozo]
recipe = zc.recipe.egg
eggs = ZODB3
scripts = repozoSimple usageModify buildout.cfgparts =
   ...
   bkups3

[bkups3]
recipe = c2.recipe.bkups3
use_s3 = true
aws_id = xxxxxxxxxxxxx
aws_key = xxxxxxxxxxxxxxxxxxxxxxxxxx
bucket_name = xxxxxxxxxx
bucket_sub_folder = mysitename
sync_s3_filesfolder = true
blob_store_count = 7Run the buildoutbin/buildout -NYou can use backup scriptsbin/bkups3You will see  filestorage backups invar/backups, blobstorage backup invar/blobbackupsand the Amazon Web Service S3 bucket which you sepecified.Detailed DocumentationSupported optionsThe recipe supports the following options:blob_bk_dir_namesetting backup path name.
defalut: blobbackupsuse_s3default: false
Using S3 is true, Not use S3 is falseaws_id<aws access key>aws_key<aws secret key>bucket_name<S3 bucket name>
setting unique bucket name in Amazon S3bucket_sub_folderOption: Sub folder in S3 bucketsync_s3_filesfolderdefault: trueblob_store_countdefalut1Saved number of blob filesWe’ll use all options:>>> write('buildout.cfg',
    ... """
    ... [buildout]
    ... parts = bkups3
    ...
    ... [bkups3]
    ... recipe = c2.recipe.bkups3
    ... blob_bk_dir_name = blobbackups
    ... use_s3 = true # Using S3 -- true, Not use S3 -- false
    ... aws_id = xxxxxxxxxxxx
    ... aws_key = xxxxxxxxxxxxxxxxxxxxxxxxx
    ... bucket_name = xxxxxxxx
    ... bucket_sub_folder = mysitename
    ... sync_s3_filesfolder = true
    ... blob_store_count = 7 # Stored 7 times
    ... """)
>>> print system(buildout) # doctest:+ELLIPSIS
Installing backuptos3.
backup: Created /sample-buildout/var/backups/blobstorage
Generated script '/sample-buildout/bin/bkups3'.Example usageJust to isolate some test differences, we run an empty buildout once:>>> ignore = system(buildout)We’ll start by creating a buildout that uses the recipe:>>> write('buildout.cfg',
... """
... [buildout]
... parts = bkups3
...
... [bkups3]
... recipe = c2.recipe.bkups3
... use_s3 = true
... """)Running the buildout adds a bkups3 scripts to thebin/directory and, by default, it creates thevar/bkups3dirs:>>> print system(buildout) # doctest:+ELLIPSIS
Installing backuptos3.
backup: Created /sample-buildout/var/backups/blobstorage
Generated script '/sample-buildout/bin/bkups3'.
<BLANKLINE>
>>> ls('var')
d  blobbackups
>>> ls('bin')
-  bkups3
-  buildoutBackupCallingbin/bkups3results in a normal repozo backup and blobstorage backup and store to Amazon S3. We put in place a
mock repozo script that prints the options it is passed (and make it
executable). It is horridly unix-specific at the moment.>>> import sys
>>> write('bin', 'repozo',
...       "#!%s\nimport sys\nprint ' '.join(sys.argv[1:])" % sys.executable)
>>> #write('bin', 'repozo', "#!/bin/sh\necho $*")
>>> dontcare = system('chmod u+x bin/repozo')>>> import sys
>>> write('bin', 'backup',
...       "#!%s\nimport sys\nprint ' '.join(sys.argv[1:])" % sys.executable)
>>> #write('bin', 'backup', "#!/bin/sh\necho $*")
>>> dontcare = system('chmod u+x bin/backup')By default, backups are done invar/backuptos3:>>> print system('bin/bkups3')
--backup -f /sample-buildout/var/filestorage/Data.fs -r /sample-buildout/var/backups --gzip
INFO: Backing up database file: ...ContributorsManabu TERADA(terapyon), AuthorChange history1.0 (2011-12-02)No changes compared to RC2 [terapyon]1.0RC2 (2011-05-06)Bug fix for blob_files local database name [terapyon]1.0RC1 (2011-04-24)Checking update blobstorage [terapyon]1.0b4 (2011-04-18)Miss packaging fixed [terapyon]1.0b3 (2011-04-18)Miss packaging fixed [terapyon]1.0b2 (2011-04-18)Variable name changed from blob_store_len to blob_store_count [terapyon]SupportedNotuse blobstorage, for Plone 3.x (but can’t run Plone 3.x yet)[terapyon]Setting sub folder in bucket [terapyon]Not Sync mode for S3 Files [terapyon]1.0b1 (2011-04-14)Backup filestorage (using bin/buckup, collective.recipe.backup) [terapyon]Backup blobstorage [terapyon]Sending bucket of Amazon S3 [terapyon]1.0a1 (Unreleased)Created recipe with ZopeSkel
[Manabu TERADA(@terapyon)]Download