-
Python 3
Example install on ubuntu 14.04 through virtualenv:
virtualenv-3.4 venv . venv/bin/activate -
On ubuntu 14.04 package
build-essentialfor paramiko:sudo apt-get install build-essential
git clone https://github.com/evgeniy-klemin/tar-smart-backup
cd tar-smart-backup
pip install -r requirements.txtMake backup named "mybackup":
python tar_smart_backup.py "mybackup" backup /var/www/media --dst=/var/backupsBackup with syncing to remote server [email protected]:/backup:
SYNC_OPTS="--sync --ssh-user=backup --ssh-key-rsa=/home/user/some_id_rsa --ssh-host=backup.internal --remote-dir=/backups"
python tar_smart_backup.py $SYNC_OPTS "mybackup" backup /var/www/media --dst=/var/backupsRestore backup named "mybackup" stored in /var/backups to /var/www/media:
python tar_smart_backup.py "mybackup" restore /var/www/media --src=/var/backupsRestore backup named "mybackup" from remote backup server [email protected]:/backup to /var/www/media, where /var/backups temp folder:
SYNC_OPTS="--sync --ssh-user=backup --ssh-key-rsa=/home/user/some_id_rsa --ssh-host=backup.internal --remote-dir=/backups"
python tar_smart_backup.py $SYNC_OPTS "mybackup" backup /var/www/media --dst=/var/backups--count - How much backups make in each level(depth)
--levels - How much tar LEVEL-1 depth create
With --levels=3 --count=3 (five times calls):
python tar_smart_backup.py "mybackup" backup /var/www/media --dst=/var/backups --levels=3 --count=3- mybackup.tar.gz - tar LEVEL-0
- mybackup_01.tar.gz - tar LEVEL-1 depth=1
- mybackup_01_01.tar.gz - tar LEVEL-1 depth=2
- mybackup_01_02.tar.gz - tar LEVEL-1 depth=2
- mybackup_01_03.tar.gz - tar LEVEL-1 depth=2
In next backup call:
- mybackup.tar.gz - tar LEVEL-0
- mybackup_01.tar.gz - tar LEVEL-1 depth=1
- mybackup_02.tar.gz - tar LEVEL-1 depth=1
In next backup call:
- mybackup.tar.gz - tar LEVEL-0
- mybackup_01.tar.gz - tar LEVEL-1 depth=1
- mybackup_02.tar.gz - tar LEVEL-1 depth=1
- mybackup_02_01.tar.gz - tar LEVEL-1 depth=2