PostgreSQL (including Postgis) and Redis are required to run backupper.
Script to create tables in DB — cropio_api_structure.sql
-
install ruby-2.3.1, rubygems, bundler
-
run
bundle install
-
add required environment variables:
REDIS_HOST=localhost DB_NAME=cropio_api DB_PORT=5432 DB_USERNAME=cropio DB_PASSWORD=cropio DB_HOST=localhost START_DOWNLOAD_YEAR=2015 DOWNLOAD_PERIOD=year (year by default, you can choose: hour, day, week, month, year) DB_SCHEMA=your database schema name
-
either
API_TOKEN
or bothCROPIO_LOGIN
andCROPIO_PASSWORD
can be used to log in -
run
bundle exec rake download_data
SatelliteImage
andVersion
are heavy and rarely used objects and disabled for downloading by default, but you can set env variable to turn on downloadingADDITIONAL_MODELS=SatelliteImage,Version
-
Install Docker for CentOS
-
Pull image from Docker Hub
docker pull cropio/cropio-backupper
-
Launch
- Container launch command example (you must specify logins and passwords in variables)
or in case you decide to use
docker run -e "REDIS_HOST=" -e "CROPIO_LOGIN=" -e "CROPIO_PASSWORD=" \ -e "DB_NAME=" -e "DB_SCHEMA=" -e "DB_PORT=" -e "DB_USERNAME=" -e "DB_PASSWORD=" -e "DB_HOST=" \ -e "DOWNLOAD_SLEEP=10" --restart=always cropio/cropio-backupper
API_TOKEN
docker run -e "REDIS_HOST=" -e "API_TOKEN=" \ -e "DB_NAME=" -e "DB_SCHEMA=" -e "DB_PORT=" -e "DB_USERNAME=" -e "DB_PASSWORD=" -e "DB_HOST=" \ -e "DOWNLOAD_SLEEP=10" --restart=always cropio/cropio-backupper
- Show log
docker ps
- show all running containersdocker logs [DOCKER_ID]
- fetch the logs of specified container
- Container launch command example (you must specify logins and passwords in variables)