Site menu:

Meta

Links:

Site search

Categories

January 2009
M T W T F S S
« Sep    
 1234
567891011
12131415161718
19202122232425
262728293031  

Tags

Blogroll

using tar to back up file with ftp

If you want to backup and upload to a ftp server you can do the following

using linux tar command

>tar cf test.tar dirname/ 

no compression

>tar cfz test.tar.gz  dirname/

tar and compress with gzip

>tar cfj test.tar.bz dirname/

tar and bunzip commpression.

After you have done above you can ftp the test.tar file to aremote ftp server.

or you can do all the above by using a shell script like below

!/bin/sh

tar cf test.tar mydirectory/

HOST=ftp.example.com

USER=test
PASS=test
FILE=test.tar

ftp -n $HOST <<EOF
quote USER $USER

quote PASS $PASS

put $FILE

quit

EOF

exit 0

 

Above script will do all the thing.

If you need any further help please contact me. I myself is a linux learner.

 

 

Comments

Comment from david
Time August 13, 2008 at 4:46 pm

thanks it has been very helpful

Write a comment