0

I need to backup a website, but I am working within size constraints. I've tried the old

tar -cpzf backup.tar.gz *

but there isn't enough free space on the host to write the file. I have a few other servers that have enough space and that support SSH though.

How would I redirect the output of the tar command (using >) to another server?

If this isn't feasible, is there a better way to do this aside from just using up a ton of bandwidth by SSHing into the other server and from there using FTP over SSH to download all the files and tarball them up?

pR0Ps
  • 265
  • 2
  • 7

3 Answers3

3

from cyberciti.biz:

tar zcvf - /wwwdata | ssh root@dumpserver.nixcraft.in "cat > /backup/wwwdata.tar.gz"

You might want to use rsync over ssh instead.

3molo
  • 4,330
  • 5
  • 32
  • 46
1

You can pipe tar thru ssh. Steps on Linux: http://www.topwebhosts.org/articles/remote-backup-tar-ssh-cron.php

Paul
  • 779
  • 1
  • 9
  • 18
-1

Here is my backup script it taks backup of website and mysql

http://paste2.org/p/1509368

Ninja
  • 192
  • 1
  • 6