Creating tar archive through FTP and moving web sites

DamnSkippy

Verified User
Joined
Mar 16, 2005
Messages
273
Location
USA, Texas
OK, does anyone know of a way to create a tar archive on the remote system when you are connected to it via FTP?

I am doing this from the root SSH CLI and the purpose is to move user web contents from one server to another. So I log into my server go to users ~ then ftp to the other server. It would be great to be able to tar up the directory and then download the tar archive.

Moving stuff this way is not something I do very often (not having ssh to both servers, just one). Seems mget * is messing up stuff as it is going to either b ASCII or Binary and there are things that need to be transfered both ways. I don't want to sit and do it almost a file at a time, maybe file type at a time.

So if you have any tips for moving web site from server to server at the CLI with SSH only to the receiving server let me know :)
 
The ftp protocol doesn't all you to run programs such as tar.

You should be able to use mget and mput to ftp multiple files without much user action, without tarring.

Jeff
 
Using mget seems to be messing up the php files. The problem is that ftp from the cli as far as I can tell does not have an auto mode for the transfer type.

So if you do an mget for everything in the directory it is do it all either binary or ascii.
 
If both origin and eventual destination are on linux or unix, then you can do everything as binary.

Jeff
 
The source server need ssh to run tar command

The target server (in case no ssh) need untar support in filemanager (DA yes)

If you have above requirement then you can do what you ask.

Try to do multiple part of tar instread of only one

some sample

#tar -czf html.tgz /public_html
#mysqldump -uuser -ppasswd dbname > dbname.sql
#tar -czf dbname.tgz dbname.sql
#rm dbname.sql

then ftp and put those tar file up.

login to DA filemanager and extract those tar files
 
It really can be done

This process can be done.

create an ftp session

you can only push, you can't pull


FTP>put |"tar cf - /usr/steve" steve.tar

This will put mantasteve.tar onto the remote server, which will have the contents of /usr/steve

Saves loads of time.

WARNING - watch out for the 2 gig file limits within the OS and FTP!

Have fun

If anyone want's to be mega clever and use a list of files in the tar command, please post you put command !
 
Please Note that DA can do both create and extract tar files via filemanager.

Also #tar, #mysqldump and #ftp could be done via cron, if your account is enabled it.
 
Back
Top