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?

link|improve this question
feedback

3 Answers

up vote 3 down vote accepted

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.

link|improve this answer
Yeah, best to use rsync... but cool tar trick I didn't know! – arkigos Jul 8 '11 at 17:57
feedback

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

link|improve this answer
feedback

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

http://paste2.org/p/1509368

link|improve this answer
The OP doesn't have space to store tarballs locally on his server. Your script requires this. – ErikA Jul 8 '11 at 17:36
Ahh sry must havet overlooked that – Ninja Jul 8 '11 at 17:44
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.