diff options
author | Sven Gothel <[email protected]> | 2010-12-31 00:42:45 +0100 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2010-12-31 00:42:45 +0100 |
commit | 6e676de98000d5498f7862902d6d1ba2e60bf513 (patch) | |
tree | 402258ff837948f39437c36c98c0b1b7e4539e75 | |
parent | 2437be8c735affe24bac11e778a048c4c2d7476a (diff) |
Adding backup script: streaming tar-xz-gpg-curl/ftp
-rw-r--r-- | backup/stream-tar-xz-gpg-ftp.sh | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/backup/stream-tar-xz-gpg-ftp.sh b/backup/stream-tar-xz-gpg-ftp.sh new file mode 100644 index 0000000..f688460 --- /dev/null +++ b/backup/stream-tar-xz-gpg-ftp.sh @@ -0,0 +1,54 @@ +#! /bin/sh + + +destproto=ftp +destserver=backup-server.net +destuid=user +destpwd=password +destencr1=0xB848A4B4 +destencr2=0x8ED60127 +destencr3=0x43681400 + +FOLDERS="\ + /opt-share \ + /opt-linux-x86 \ + /opt-linux-x86_64 \ + /srv \ + /home \ + /root \ + /etc \ + /var/lib/mysql \ + /var/spool/mail \ + /var/log \ + /var/lib/awstats \ + /usr/local/awstats" + +bbname=backup-`hostname`-`date +%Y%m%d%H%M` + +function do_ssh_tar() { + +echo +echo BEGIN $bbname +date +echo + +time nice -n 20 \ +tar cf - $FOLDERS | \ +xz --format=xz --check=crc64 --threads=4 -z -c - | \ +gpg -e --recipient $destencr1 --recipient $destencr2 --recipient $destencr3 | \ +curl -u $destuid:$destpwd $destproto://$destserver/$bbname.tar.xz.gpg -T - + +echo target backup $destuid@$destserver:$bbname.tar.xz.gpg + +echo +echo END $bbname +date +echo + +} + +do_ssh_tar >& $bbname.log & +disown $! +#do_ssh_tar 2>&1 | tee $bbname.log + |