Skip to content

gm3dmo/cmp

Repository files navigation

Corps of Military Police

Backups

A script called db_dump_csv.py dumps CSV files of the tables for cmp_* and uploads them to cmp-archive where a release is is created.

The script db_backup_csv.sh is called from cron each evening:

#!/bin/bash

# Path to your project
PROJECT_DIR=/home/azureuser/cmp

# Activate virtual environment
source $PROJECT_DIR/.venv/bin/activate

# Set environment variables if needed
export DJANGO_ENV=production

# Run the script
cd $PROJECT_DIR
python scripts/db_dump_csv.py

# Deactivate virtual environment
deactivate

Crontab entry:

15 18 * * * /home/azureuser/db_backup_csv.sh > /home/azureuser/logs/db_dump.log 2>&1

Development Notes

For configuration django-environ is used.

Countries

The countries are extracted from this article:

https://en.wikipedia.org/wiki/List_of_ISO_3166_country_codes

Test Coverage

Coverage Status

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •