[ckan-changes] commit/ckanext-dgu: 2 new changesets

Bitbucket commits-noreply at bitbucket.org
Wed Aug 10 11:45:37 UTC 2011


2 new changesets in ckanext-dgu:

http://bitbucket.org/okfn/ckanext-dgu/changeset/4d2ddb7295f4/
changeset:   4d2ddb7295f4
user:        dread
date:        2011-08-10 13:30:50
summary:     [bin/gov_daily]: Change backup dir to plural: /var/backups/.
affected #:  1 file (2 bytes)

--- a/ckanext/dgu/bin/gov_daily.py	Wed Aug 10 10:59:32 2011 +0100
+++ b/ckanext/dgu/bin/gov_daily.py	Wed Aug 10 12:30:50 2011 +0100
@@ -51,12 +51,12 @@
     ckan_instance_name = os.path.basename(config_file).replace('.ini', '')
     if ckan_instance_name != 'development':
         default_dump_dir = '/var/lib/ckan/%s/static/dump' % ckan_instance_name
-        default_backup_dir = '/var/backup/ckan/%s' % ckan_instance_name
+        default_backup_dir = '/var/backups/ckan/%s' % ckan_instance_name
         default_log_dir = '/var/log/ckan/%s' % ckan_instance_name
     else:
         # test purposes
         default_dump_dir = '~/dump'
-        default_backup_dir = '~/backup'
+        default_backup_dir = '~/backups'
         default_log_dir = '~'
     dump_dir = os.path.expanduser(config.get('ckan.dump_dir',
                                              default_dump_dir))


http://bitbucket.org/okfn/ckanext-dgu/changeset/33697707fa8b/
changeset:   33697707fa8b
user:        dread
date:        2011-08-10 13:44:32
summary:     [bin/gov_daily]: Dumps now compressed. Also fixed script having moved command.py.
affected #:  2 files (362 bytes)

--- a/ckanext/dgu/bin/dump_analysis.py	Wed Aug 10 12:30:50 2011 +0100
+++ b/ckanext/dgu/bin/dump_analysis.py	Wed Aug 10 12:44:32 2011 +0100
@@ -12,7 +12,7 @@
 from datautil.tabular import TabularData, CsvReader, CsvWriter
 from sqlalchemy.util import OrderedDict
 
-from ckanext.dgu import command
+from ckanext.importlib import command
 
 log = logging.getLogger('dump_analysis')
 


--- a/ckanext/dgu/bin/gov_daily.py	Wed Aug 10 12:30:50 2011 +0100
+++ b/ckanext/dgu/bin/gov_daily.py	Wed Aug 10 12:44:32 2011 +0100
@@ -152,6 +152,15 @@
         logging.info('Backup successful: %s' % pg_dump_filepath)
     else:
         logging.error('Backup error: %s' % ret)
+    logging.info('Zipping up backup')
+    pg_dump_zipped_filepath = pg_dump_filepath + '.gz'
+    cmd = 'gzip %s' % pg_dump_filepath
+    logging.info('Zip command: %s' % cmd)
+    ret = os.system(cmd)
+    if ret == 0:
+        logging.info('Backup gzip successful: %s' % pg_dump_zipped_filepath)
+    else:
+        logging.error('Backup gzip error: %s' % ret)
 
     # Log footer
     report_time_taken()

Repository URL: https://bitbucket.org/okfn/ckanext-dgu/

--

This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.




More information about the ckan-changes mailing list