1755854 Members
3065 Online
108838 Solutions
New Discussion юеВ

ftp script help

 
SOLVED
Go to solution
George_Dodds
Honored Contributor

ftp script help

Allo peeps

yet again i need help with a script :)

Scenario i have 4 filsystems that i want to be able to backup to another server.

I want to compress the data first and then ftp it from server 1 to server 2 automatically.

i'll use cron to run this script daily.

Thanks in advance

George
4 REPLIES 4
V. V. Ravi Kumar_1
Respected Contributor
Solution

Re: ftp script help

hi,
pl. search in the forums for "ftp script", there are lot of questions on this.

iam giving two of them.

http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0xcde591ccb36bd611abdb0090277a778c,00.html

http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0xadc85a3e6e0bd6118ff40090279cd0f9,00.html

Regards
Ravi
Never Say No
John Meissner
Esteemed Contributor

Re: ftp script help

in your script you can run the tar and gzip commands on the data that you wish to backup. after you do that you can use this part of a script

#! /usr/bin/ksh
ftp -n -i <open hostname
user username password
bin
put filename
quit
HERE

after you create this script you can add and entry into crontab to run it when you want
All paths lead to destiny
Leif Halvarsson_2
Honored Contributor

Re: ftp script help

Hi,
Do you want to backup the files to a disk or a tape device on the remote system ?

In the first case perhaps rcp (remote copy) is better for this task.

Some ideas:

Create a tar file for the filesystem on a temporary location.
Compress the tar file.

Use rcp to copy the compressed file to the remote location (see man page for rcp).

Delete the file from the temporary location.

Of course this needs you have enough space for the temporary file.

If you want to backup to a tape device, fbackup is a better alternative.
steven Burgess_2
Honored Contributor

Re: ftp script help

Hi George

How's things ?

I would use rdist

http://xray.chm.bris.ac.uk:8000/labstuff/rdist.html

hth

steve
take your time and think things through