Skip to main content
Join the official 2020 Python Developers SurveyStart the survey!

Used to upload files to cold storage

Project description

coldsync

Build Status Coverage Status PyPI version License Downloads

Python 3.4 Python 3.5 Python 3.6 Python 3.7 Python 3.8 Pypy 3.5

Backup important files to cold storage.

pip install coldsync

Google Cloud Storage is supported for now. The API is can be extend to add support other providers. Inside the storage module extend the BaseStorage to add support for other providers.

Usage

To use the commands you must first setup the following environment variables:

  • CS_DATA_CENTER
  • CS_PROJECT_NAME
  • CS_ENV_NAME
  • CS_GOOGLE_SERVICE_ACCOUNT_PATH

Where CS_DATA_CENTER, CS_PROJECT_NAME, CS_ENV_NAME are used to identify the bucket in which files are stored.

The CS_GOOGLE_SERVICE_ACCOUNT_PATH must point to your google credentials.json file.

Examples

Show all files inside the bucket

CS_DATA_CENTER='central-europe' \
CS_PROJECT_NAME='coold-data-storage' \
CS_ENV_NAME='production' \
CS_GOOGLE_SERVICE_ACCOUNT_PATH='credentials.json' \
coldsync list-files

Upload a file to the bucket

You may need to mount the file in the docker container in order to have access to it.

CS_DATA_CENTER='central-europe' \
CS_PROJECT_NAME='coold-data-storage' \
CS_ENV_NAME='production' \
CS_GOOGLE_SERVICE_ACCOUNT_PATH='credentials.json' \
coldsync upload-file sample.jpg --remote_path 'thecat.jpg'

Download a file from the bucket

You may need to mount the download directory in the docker container in order to have access to the files which have been downloaded from your local file system.

CS_DATA_CENTER='central-europe' \
CS_PROJECT_NAME='coold-data-storage' \
CS_ENV_NAME='production' \
CS_GOOGLE_SERVICE_ACCOUNT_PATH='credentials.json' \
coldsync download-file 'thecat.jpg' thecat.jpg

Deleting a file from the bucket

CS_DATA_CENTER='central-europe' \
CS_PROJECT_NAME='coold-data-storage' \
CS_ENV_NAME='production' \
CS_GOOGLE_SERVICE_ACCOUNT_PATH='credentials.json' \
coldsync delete-file 'thecat.jpg'

Tests

Running test suite

python setup.py test

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for coldsync, version 0.0.4
Filename, size File type Python version Upload date Hashes
Filename, size coldsync-0.0.4.tar.gz (4.8 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page