The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
UNIX logon script/batch oht UNIX for Dummies Questions & Answers 1 09-05-2007 03:04 PM
Logon script capeme UNIX for Dummies Questions & Answers 4 12-06-2006 07:58 AM
Default ALOM username and password for the Sun servers muthulingaraja UNIX for Advanced & Expert Users 1 10-11-2006 07:37 AM
umask setting on a logon script karthikosu AIX 2 06-22-2006 09:38 AM
ASCII character to accept logon password gord UNIX for Dummies Questions & Answers 8 02-02-2006 12:58 PM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 01-05-2008
razeeev's Avatar
Registered User
 

Join Date: Jan 2008
Posts: 1
Arrow How to script to logon servers using id and password

Hey..
I am new in scripting.. I know a little bit of scripting.. I am facing some problem.. I need to create a script using which I may log on to a server (e.g. ftp) with ID and password.. thus copy a particular file to a local dir.. the commands required to do that I do know.. I am able to do it manually.. Can any one please inform me in detail how may I do it using a script?? the problem i am facing is the input of username and password using the script.. and secondly how may I run or execute a script at a particular time every day.. actually I need to copy a file using ftp everyday at 4PM.. and I need to do it using script.. please help me to do that..

With thanks and regards
AL MAMUN MAHBUB
Reply With Quote
Forum Sponsor
  #2  
Old 01-05-2008
Registered User
 

Join Date: Dec 2005
Location: Madison, WI
Posts: 6
Not sure why you did not google this, but something like follows is what you are looking for,

#!/bin/sh
HOST='ftp.users.qwest.net'
USER='yourid'
PASSWD='yourpw'
FILE='file.txt'

ftp -n $HOST <<END_SCRIPT
quote USER $USER
quote PASS $PASSWD
put $FILE
quit
END_SCRIPT
exit 0

taken from, Using ftp in a shell script
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 07:17 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0