twitter facebook

Linux でフォルダ丸ごとバックアップするコマンド

フォルダを丸ごとバックアップするlinuxコマンドです。
  • バックアップ元
  • /var/www/html/hogehoge.com
  • バックアップ先
  • /temp/hogehoge.com.tar.bz2
tar -cvjf /temp/hogehoge.com.tar.bz2 /var/www/html/hogehoge.com
img フォルダだけは除外したいような場合は --exclude :img をつけます。
tar -cvjf /temp/hogehoge.com.tar.bz2 /var/www/html/hogehoge.com --exclude img
img、cache といった複数のフォルダーを除外したい場合は
tar -cvjf /temp/hogehoge.com.tar.bz2 /var/www/html/hogehoge.com --exclude img --exclude img
AUTHOR
@jiji
最終更新日 2018/09/17
FAVORITE good stock
LINK TAG
記法を見る