Created
September 17, 2012 01:49
-
-
Save ebith/3735146 to your computer and use it in GitHub Desktop.
tarで固めてlzoで圧縮してDropboxに送るバックアップスクリプト
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 | |
# バックアップ対象ディレクトリ | |
target="/etc /home/ebith" | |
# 除外パターン | |
exclude=(sites/www/rep2 .cpanm .rbenv) | |
# 一時ファイル | |
tempfile="/tmp/backup.tar.lzo" | |
for v in ${exclude[@]}; do | |
e="$e --exclude=$v" | |
done | |
tar --lzop -cf $tempfile $target $e | |
./dropbox_uploader.sh upload $tempfile /backup/`basename $tempfile` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment