Skip to main content

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

Project details


Download files

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

Source Distribution

coldsync-0.0.4.tar.gz (4.8 kB view details)

Uploaded Source

File details

Details for the file coldsync-0.0.4.tar.gz.

File metadata

  • Download URL: coldsync-0.0.4.tar.gz
  • Upload date:
  • Size: 4.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.5.2

File hashes

Hashes for coldsync-0.0.4.tar.gz
Algorithm Hash digest
SHA256 0ec8205c1c074cfa9ac6fc02d0bd0d478edd42ca45238db1652c216012007467
MD5 2c53d903d85636d7eb03bb74bb5c91bd
BLAKE2b-256 e672268ed703f004c664098633f77607b8597d12d0b8833a03a2313286b3d953

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page