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.4.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0c85a442923e8fa76568731fa7a0c28cb6309942153a997d1df44d2d23fb20c8 |
|
MD5 | e886777a06ef4730c1781471731ad4f0 |
|
BLAKE2b-256 | c0dce4dda33e300770db5e3706fe0e3a5fc6c5bcd0e0be9a279522f305ef97c5 |