From: Ian Collins on
On 04/28/10 05:34 PM, Sami Ketola wrote:
> hadi motamedi<motamedi24(a)gmail.com> wrote:
>>> Is there a reason why you are still using Solaris 8?
>>>
>>> Blastwave should have them.
>>
>> I have an old application that just runs on Solaris8 Sparc , so I am
>> seeking tools applicable for this application.
>> Thank you
>
> Have you tried to run it on Solaris 10?

Or in a branded zone?

--
Ian Collins
From: hadi motamedi on
> Have you tried to run it on Solaris 10?
I don't have any Solaris10 on Sparc at hand at now , but will try for
it in the near future.BTW, I had ftp service on my Solaris8 Sparc and
then I tried to install 'ncftpd-2.8.6-solaris8-sparc-export.tar.gz' on
it but un-successful. After that, I saw the previous ftp service is no
longer working. I have the Solaris8 for Sparc installation CD at hand.
Can you please let me know how to recover my previous ftp service from
it?
Thank you

From: webjuan on
On Apr 28, 1:03 am, hadi motamedi <motamed...(a)gmail.com> wrote:
> > I've used wget or curl for this.  ftp doesn't really lend itself to
> > 1-line logins.  Choose the right tool for the right job.
>
> Sorry. My Solaris8 on Sparc does not have wget or curl . Can you
> please let me know if there is another utility for this job?
> Thank you

You might consider looking into using a .netrc file. Granted, your
login credentials will be stored in plain text but that could provide
you another option to look into. On my Solaris 10 box, I can run "man
netrc" to get the appropriate man page.

juan martinez
From: Fred on
On Apr 28, 5:54 am, hadi motamedi <motamed...(a)gmail.com> wrote:
> Dear All
> I want to run my ftp command in one line , like the following :
> %ftp user user-name pass-word 172.16.17.160 << docs
> But it cannot get through . Can you please correct me?
> Thank you

cat << EOM | ftp -n 172.16.17.160
user-name
pass-word
bin
send docs
quit
EOM
From: solx on
On 28/04/2010 05:54, hadi motamedi wrote:
> Dear All
> I want to run my ftp command in one line , like the following :
> %ftp user user-name pass-word 172.16.17.160<< docs
> But it cannot get through . Can you please correct me?
> Thank you

Hi,

Create a ~/.netrc file which will allow you to define multiple ftp site,
with an associated set of commands which allow to create a
timed ftp script

eg

=================== .netrc ===================

machine ftp.rs.internic.net login anonymous password myname(a)email.co.uk

macdef init
lcd /var/named
cd domain
bin
prompt off
get named.root
!chmod 644 named.root
bye

=================== .netrc ===================

When a users wants to get the named.root file for dns

$ ftp ftp.rs.internic.net
$

all the commands are run.


The timed-ftp script below was used to access virus pattern data files
but due to heavy load the ftp session hung some times which resulted in
numerous ftp sessions. The script prevented this problem, I also used it
to ftp files over VPN links which failed due to problems at the
destination site.

=================== timed-ftp.sh =================

#!/bin/sh
# ftp transfer typically takes 3 minutes to complete,
#
#
# 2004-04-26 - Modified to work with supplied ftp site via command line
#
#
# 2004-04-29 - Modified to work with supplied time via command line
#
#

# check that ftp site is supplied
if [ -z "${1}" ]; then
echo "usage: timed-ftp.sh <ftp site> <minutes - default 30>"
echo " ftp site must be in .netrc"
exit 1
fi

UPDATE_FTP_CMD=`echo $0`
FTP_DURATION=30
FTP_CHECK_SECONDS=60
FTP_SESSION_ID=`date +%U%a%T`
FTP_UPDATE=/tmp/timed.ftp.in.progress.${FTP_SESSION_ID}.${1}
FTP_PID=0
FTP_STATUS_OK="ok"
FTP_STATUS_BUSY="busy"
FTP_STATUS=${FTP_STATUS_OK}

# check that ftp wait period supplied is greater than default
if [ -n "${2}" ]; then
if [ ${2} -gt ${FTP_DURATION} ]; then
FTP_DURATION=${2}
fi
fi

ftp_update()
{
echo ${FTP_STATUS_BUSY} > ${FTP_UPDATE}
echo "root : ftp $1 transfer - start"
ftp $1 2>&1 > /dev/null
echo "root : ftp $1 transfer - finish"
echo ${FTP_STATUS_OK} > ${FTP_UPDATE}
}

# check for presence of .netrc file
cd
if [ -r .netrc ]; then
echo "root : .netrc found"
else
echo "root : .netrc NOT FOUND"
cp -p /sysadmin/bin/netrc.root ./.netrc
fi

# check if ftp in progress
if [ -f ${FTP_UPDATE} ]; then
echo "root : ftp transfer currently in progress - aborting"
exit 1
fi

# create an ftp in progress file then background ftp update and record pid
echo "root : ftp transfer lock file - create"
touch ${FTP_UPDATE}
echo "root : starting ftp transfer as background process"
ftp_update ${1} &
FTP_PID=`echo $!`
sleep 5

# sleep enough time for ftp to complete
echo "root : allowing ${FTP_DURATION} minutes for ftp transfer"
echo " checking every ${FTP_CHECK_SECONDS} seconds"
FTP_LOOP=${FTP_DURATION}
while [ ${FTP_LOOP} -gt 0 -a `cat ${FTP_UPDATE}` != ${FTP_STATUS_OK} ]; do
sleep ${FTP_CHECK_SECONDS}
FTP_LOOP=`expr ${FTP_LOOP} - 1`
done
echo "root : checking for hung ftp transfer"

# kill ftp process, record kill status and remove in progress file
FTP_STATUS=`cat ${FTP_UPDATE}`
if [ ${FTP_STATUS} = ${FTP_STATUS_OK} ]; then
echo "root : ftp completed successfully."
else
echo "root : ftp transfer still busy - killing process"
kill -9 ${FTP_PID}
FTP_OK=`echo $?`
if [ ${FTP_OK} -ne 0 ]; then
echo "root : ftp process finished before kill request"
else
echo "root : ftp process was killed after ${FTP_DURATION} secs"
fi
fi

echo "root : ftp transfer lock file - delete"
rm ${FTP_UPDATE}
#
# ensure no running ftp sessions
#
pkill -9 ftp

=================== timed-ftp.sh =================