Python module to manage Digitalocean droplet backups.
Project description
## Synopsis:
This module works with [python-digitalocean](https://github.com/koalalorenzo/python-digitalocean) to allow you to rsync and snapshot your droplets with ease. **Great for hourly cron jobs!**
###### Works with posix (*nix, osx, cygwin)
Tested with Python 2.7.8(CYGWIN), 2.7.9(OS X/Linux), 3.4.3(OS X/Linux)
## How to install:
via pip
pip install -U python-digitalocean-backup
via source
python setup.py install
##### PyPI package
[https://pypi.python.org/pypi/python-digitalocean-backup](https://pypi.python.org/pypi/python-digitalocean-backup)
##### Example backup script (backup.py):
```python
import digitalocean
from digitaloceanbackup import Backup
"""Uncomment to disable logging for InsecurePlatformWarning"""
"""
import sys
if sys.version_info[:3] < (2, 7, 9):
import logging
logging.captureWarnings(True)
"""
token = 'YOUR_TOKEN'
rsync_excludes = ['cache', '.DS_Store', 'man3']
remote_dirs = ['/home', '/var/log', '/var/www']
manager = digitalocean.Manager(token=token)
for droplet in manager.get_all_droplets():
Backup(
debug=False, # print debug info so you can see shell commands
droplet=droplet, # pass in a droplet obj
ssh_user='droplet_ssh_user', # ssh user
ssh_key='droplet_ssh_key', # ssh key file name or full path
remote_dirs=remote_dirs, # remote directories to rsync
rsync_excludes=rsync_excludes, # rsync excludes
snapshot_hour=3, # hour of day to take snapshot
keep_snapshots=7 # keep this many snapshots
)
```
##### Example hourly cron job:
```sh
0 * * * * /usr/bin/python /Users/username/bin/backup.py
```
###### Requires:
[python-digitalocean>=1.5](https://github.com/koalalorenzo/python-digitalocean)
This module works with [python-digitalocean](https://github.com/koalalorenzo/python-digitalocean) to allow you to rsync and snapshot your droplets with ease. **Great for hourly cron jobs!**
###### Works with posix (*nix, osx, cygwin)
Tested with Python 2.7.8(CYGWIN), 2.7.9(OS X/Linux), 3.4.3(OS X/Linux)
## How to install:
via pip
pip install -U python-digitalocean-backup
via source
python setup.py install
##### PyPI package
[https://pypi.python.org/pypi/python-digitalocean-backup](https://pypi.python.org/pypi/python-digitalocean-backup)
##### Example backup script (backup.py):
```python
import digitalocean
from digitaloceanbackup import Backup
"""Uncomment to disable logging for InsecurePlatformWarning"""
"""
import sys
if sys.version_info[:3] < (2, 7, 9):
import logging
logging.captureWarnings(True)
"""
token = 'YOUR_TOKEN'
rsync_excludes = ['cache', '.DS_Store', 'man3']
remote_dirs = ['/home', '/var/log', '/var/www']
manager = digitalocean.Manager(token=token)
for droplet in manager.get_all_droplets():
Backup(
debug=False, # print debug info so you can see shell commands
droplet=droplet, # pass in a droplet obj
ssh_user='droplet_ssh_user', # ssh user
ssh_key='droplet_ssh_key', # ssh key file name or full path
remote_dirs=remote_dirs, # remote directories to rsync
rsync_excludes=rsync_excludes, # rsync excludes
snapshot_hour=3, # hour of day to take snapshot
keep_snapshots=7 # keep this many snapshots
)
```
##### Example hourly cron job:
```sh
0 * * * * /usr/bin/python /Users/username/bin/backup.py
```
###### Requires:
[python-digitalocean>=1.5](https://github.com/koalalorenzo/python-digitalocean)
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
Close
Hashes for python-digitalocean-backup-1.0.6.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | df73d603b06d8febf7aa8f6a1f05d9e5825f0c7893496639e59a8303fa97f6ec |
|
MD5 | cd514371ead79fc8fcb9c9ee3e5b3dea |
|
BLAKE2b-256 | 6b36acbd567326a5e0f21612e8b7c6b57128b92e7b35e7e3aa56cba8e23568f6 |