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.5.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4da14ff1bd5c3825c5c3d2471006ccf4e42a489ee118c92d420744122717b291 |
|
MD5 | 21d86203c70bb51dc97986802c4d093e |
|
BLAKE2b-256 | ffda45fc7098d8aaf843474b3527b5d43de636e1a94f1eb4b75dda1e77d44371 |