LoginSignup
7
12

More than 5 years have passed since last update.

サーバのデータ移行で使うコマンドをまとめる

Last updated at Posted at 2014-10-30

利用するコマンド

  • tar ->圧縮&解凍
  • df ->ディスクの容量チェック
  • du ->ディレクトリの容量チェック
  • wget ->ファイル転送
  • scp ->ファイル転送
  • sync ->ファイル転送

実行例

ファイルを圧縮

tar zcvf backup.tar.gz file1 file2

ファイルを解凍

tar zxvf filename

ディスクの容量チェック

 df -h
# -h => 人間が読みやすいかたち

ディレクトリの容量チェック

du -s -h [ディレクトリ]
# -s =>引数の合計容量, -h =>人間が読みやすいかたち

転送系(wget)

wget http://xxx.xxx.xxx.xxx./[filename]

転送系(scp)

 scp -i ~/.ssh/id_rsa -P 2022 -r [ディレクリ名] user@xxx.xxx.xxx.xxx:/tmp/

転送系(rsync)

 rsync -avzhe "ssh -i /home/user/.ssh/id_rsa"  --progress --partial --append  [ディレクトリ名] user@xxx.xxx.xxx.xxx:/tmp/
7
12
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
7
12