Skip to content

Instantly share code, notes, and snippets.

@ebith
Created September 17, 2012 01:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ebith/3735146 to your computer and use it in GitHub Desktop.
Save ebith/3735146 to your computer and use it in GitHub Desktop.
tarで固めてlzoで圧縮してDropboxに送るバックアップスクリプト
#!/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