This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# source: https://www.raspberrypi.org/forums/viewtopic.php?f=91&t=46911 | |
# backup | |
sudo dd bs=4M if=/dev/sdd | gzip > raspbian-`date +%d%m%y`.img.gz | |
# restore | |
gzip -dc image.gz | sudo dd bs=4M of=/dev/sdd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Duplicity wrapper | |
# | |
# Not working for now. Yandex prevents uploading lagre files via webdav. | |
# add to crontab: | |
# 0 0 * * * /bin/sh /usr/local/sbin/backup-host.sh | |
set -e |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
export PATH=$PATH:/usr/bin:/usr/sbin | |
export RECIPIENTS='[email protected], [email protected]' | |
export FROM='admin' | |
# Setup passwords in /root/.pgpass | |
export BACKUP_USERS='django postgres' | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from kazoo.client import KazooClient | |
from kazoo.retry import KazooRetry | |
retry = KazooRetry(max_tries=-1, max_delay=6) | |
zk = KazooClient(hosts='127.0.0.1:2181', connection_retry=retry) | |
zk.start(timeout=None) |