digitalocean.com droplet rsync and snapshot
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
##### Example backup script (backup.py):
```python
import digitalocean
from digitaloceanbackup import backup
token = 'YOUR_TOKEN'
rsync_excludes = ['cache', '.DS_Store', 'man3', 'terminfo']
remote_dirs = ['/home', '/var/log', '/var/www']
manager = digitalocean.Manager(token=token)
for droplet in manager.get_all_droplets():
backup(
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
##### Example backup script (backup.py):
```python
import digitalocean
from digitaloceanbackup import backup
token = 'YOUR_TOKEN'
rsync_excludes = ['cache', '.DS_Store', 'man3', 'terminfo']
remote_dirs = ['/home', '/var/log', '/var/www']
manager = digitalocean.Manager(token=token)
for droplet in manager.get_all_droplets():
backup(
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.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 16a32e3cf79cdaaac2c75265c502e9dbb6fb26aea06e4222819713cd6e85cdd0 |
|
MD5 | adbbfe41bc515686bd504235608355f2 |
|
BLAKE2b-256 | aadd4b9132f25c12ab316bf8e713f4ba538cbbeb5d1b57dac05cb68ebeca1cd5 |