cron to check ftp upload/download

karlp at ourldsfamily.com karlp at ourldsfamily.com
Mon Mar 21 19:11:27 UTC 2005


> karlp at ourldsfamily.com wrote:
>>>can u tell me a little sort of script line that i will put in.
>>>
>>>wget ftp://tivimtech.com/*.* .......rest i do not know
>>>how will i specify user name and password ? and will *.* download all
>>> file
>>>of ftp server in any folder?
>>
>>
>> Frankly, I'd use ftp to do it and run a script like this one I wrote
>> (you'll have to change the PUT to GET and any associated syntax):
>>
>> #!/bin/sh
>> if [ "$6" = '' ] &&
>>    [ "$5" = '' ] &&
>>    [ "$4" = '' ] &&
>>    [ "$3" = '' ] &&
>>    [ "$2" = '' ] &&
>>    [ "$1" = '' ]
>>  then
>>    echo
>>    echo Usage: $0 DestHost USERNm PASSWd LocalPth2Dir RemotePth2Dir
>> FNAME
>>    echo
>>    exit 1
>> fi
>> HOST=$1
>> USERNM=$2
>> PASSWD=$3
>> LPATH=$4
>> RPATH=$5
>> FNAME=$6
>> ftp -p -n $HOST 2>/dev/null  <<- End_of_FTP_commands
>> user $USERNM $PASSWD
>> lcd $LPATH
>> cd $RPATH
>> put $FNAME
>> End_of_FTP_commands
>
> Uh, how about:
>
> #!/bin/bash
> if [ $# -lt 6 ]; then

Duh.
I'm not that far into any of the self-help books I'm learning from...
Hey, it works. Thanks Rick.


>      echo
>      echo Usage: $0 remotehost username passwd localpath remotepath fname
>      echo
>      exit 1
> fi
> ncftpget -d /var/log/ncftpget.log -u $2 -p $3 $1 $4 $5/$6

Not available on my server (AIX 4.3.3) and the Linux Toolbox isn't
installed. With a new server nearly on order which WILL have the Linux
toolbox, It'll be happening soon.

Karl

>
> ----------------------------------------------------------------------
> - Rick Stevens, Senior Systems Engineer     rstevens at vitalstream.com -
> - VitalStream, Inc.                       http://www.vitalstream.com -
> -                                                                    -
> -   The light at the end of the tunnel is really an oncoming train.  -
> ----------------------------------------------------------------------
>
> _______________________________________________
> Redhat-install-list mailing list
> Redhat-install-list at redhat.com
> https://www.redhat.com/mailman/listinfo/redhat-install-list
> To Unsubscribe Go To ABOVE URL or send a message to:
> redhat-install-list-request at redhat.com
> Subject: unsubscribe
>





More information about the Redhat-install-list mailing list