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.
Posted: August 13th, 2008 under linux debian ubuntu.
Comment from david
Time August 13, 2008 at 4:46 pm
thanks it has been very helpful