@sudo-upostgrespsqlmentat_events-c"COPY FROM stdin;"</vagrant/data/devsnapshot/events/events.dat
@sudo-upostgrespsqlmentat_events-c"COPY FROM stdin;"</vagrant/data/devsnapshot/events/events_json.dat
@echo""
@sudo-upostgrespsqlmentat_main-e-c"select count(*) as user_count, min(createtime) as from_date, max(createtime) as to_date from users;"
...
...
@@ -519,6 +517,9 @@ data-import-dbsnapshot: FORCE
@sudo-upostgrespsqlmentat_main-e-c"select count(*) as report_count, min(createtime) as from_date, max(createtime) as to_date from reports_events;"
@sudo-upostgrespsqlmentat_main-e-c"select count(*) as statistics_count, min(createtime) as from_date, max(createtime) as to_date from statistics_events;"
@sudo-upostgrespsqlmentat_main-e-c"select count(*) as changelog_count, min(createtime) as from_date, max(createtime) as to_date from changelogs_items;"
@sudo-upostgrespsqlmentat_events-e-c"select count(*) as event_count, min(createtime) as from_date, max(storagetime) as to_date from events;"
@sudo-upostgrespsqlmentat_events-e-c"select count(*) as event_json_count, min(createtime) as from_date, max(storagetime) as to_date from events_json;"
print_subtitle "Dumping chunk of table thresholds from event database"
sudo-u mentat psql mentat_events -c"copy (select * from thresholds where thresholdtime >= '${BACKUP_DATE_FROM}'::timestamptz) to stdout">${BACKUP_DIR}/thresholds.dat
print_subtitle "Size before packaging:"
du-csh /var/mentat/devsnapshots/devsnapshot
print_subtitle "Packaging created database snapshots"