I am accessing a shared hosting account through Putty / SSH. The account is pretty full, 300 MB below its quota. I need to make a full backup of all data present on the account. Creating a bzip2 file using
tar cjf archive.tar.bz2 directory/*
fails because there is not enough space for the tar.
Does anybody know a way to create a tar file and "stream" it to a local file on my PC? Through putty or any other SSH tool?
If you have cygwin, then you can just run something like this on your local machine:
and it will put the tar archive in c:\archive.tar.bz2
If you don't have cygwin, you can do the same thing with plink (part of PuTTY) from a command window;
(I'm assuming you're on Windows if you're using PuTTY - if you're on Linux, just run the ssh command)
Use WinSCP.
Quotas are enforced on a per filesystem basis. If /tmp has enough space available, there's a good chance you can use it.
To pipe tar through SSH:
ssh server "tar -cf - /home/user" | tar xvf -
on unix/linux it's very easy to push a tar stream (or any stream) over the network.
PUSH: (if your logged into the machine where the data is)
tar zcvf - /wwwdata | ssh [email protected] "cat > /backup/wwwdata.tar.gz"
PULL: (logged into your workstation for instance)
ssh tar cf - -C sourcedir . | tar xvf -
ssh tar cf - -C sourcedir . | cat > /backup/mywwwdata.tar
now, on windows, you maybe able to do this with the ssh that comes with http://www.cygwin.com/
I'm using plink as a test to 'pull' the entire tree from my iphone via usb networking just to test it.
Works great!
iPhone processor has teh slowness, so it comes in spurts. But, it's working perfectly.
NOTE: Leave out the "--verbose" part for quiet/save bandwidth. I included it so that I'd get something on my screen to let me know it was working right. Spewing all that information would defeat the purpose of saving pipe/speed. I only used it to confirm function.