Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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?

share|improve this question

3 Answers 3

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.

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

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

share|improve this answer

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

http://paste2.org/p/1509368

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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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