LoginSignup
2
2

More than 5 years have passed since last update.

Sakura VPSのバックアップをとりたいがディスク不足なとき

Last updated at Posted at 2013-05-22

環境は入れ直すとして。
ホームディレクトリのデータだけ持っていきたい。でも、アーカイブを作る空き容量すらない。
そんなとき、あると思います。

www14242u$ sudo tar zcf adachi.tgz adachi
[sudo] password for adachi: 

gzip: stdout: No space left on device
www14242u$ df -h
Filesystem          サイズ  使用  残り 使用% マウント位置
/dev/hda2              18G   18G     0 100% /
/dev/hda1              99M   18M   76M  19% /boot
tmpfs                 502M     0  502M   0% /dev/shm

ってなります。じゃあ、sshトンネリングして送ります。

ssh root@glasshill.biz "(cd /home && tar cf -)" | tar xvfp -

これで解決w
手元に全部そのままのデータがきます。これのいいところはパーミッション情報かわらないところかな。

余談だが、こっちから向こうに転送したいときは、こうかな。

(cd path && tar cf - .) | ssh user@hostname "(cd path && tar xvfp -)"
2
2
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
2
2