Sponsored Content
Top Forums Shell Programming and Scripting ftp and telnet in the same script ?? Urgent Help !! Post 302072030 by aarora_98 on Wednesday 26th of April 2006 01:26:33 PM
Old 04-26-2006
Now I am able to telnet to machine2 with certain changes.

But when it connect to machine2... it gives me following error and cmds are not executed as it get connected to machine2.


Changes made are:


ftp machine2 << END_SCRIPT
-- some cmds--
--
--
quit
END_SCRIPT


telnet machine2 <<END_SCRIPT
--some cmds-
--
--
END_SCRIPT



Error is (when it try to connect to machine2 through telnet) :

Trying IP_OF_MACHINE2...
Connected to machine2
Escape character is '^]'.
Connection closed by foreign host.

I am providing the user name and psw for the machines through variables.
Plz let me know if any body has some idea about this.


Thnx..
Aru
 

10 More Discussions You Might Find Interesting

1. IP Networking

FTP or Telnet

Dumb question I'm sure but how on earth do I transfer files from a sco unix machine to my windows 2000 machine. I'm typing commands on my Win2000 machine. All I can seem to do is move files around on the unix system? (8 Replies)
Discussion started by: Timbash
8 Replies

2. Linux

ftp telnet enable

hi , i have jsut installed linux 9.0 , but i can not ftp or telnet to the system . i have installed the ftp and the telnet server during installation . i have also configured the files to enable the ftp and telnet , the ftp and the telnet daemons are running , but when i do ftp : ftp... (1 Reply)
Discussion started by: ppass
1 Replies

3. UNIX for Dummies Questions & Answers

Urgent FTP script automation

Hi guys, Here is my requirement for ftp script that i have to automate in unix using shell script: 1) Find the files that atre created one week from the present day. 2) ftp them to the backup server. 3) At the end of the month make a new directory on my backup server with the new month(eg:Once... (1 Reply)
Discussion started by: koduri0475
1 Replies

4. UNIX Desktop Questions & Answers

Urgent FTP script automation

Hi guys, Here is my requirement for ftp script that i have to automate in unix using shell script: 1) Find the files that atre created one week from the present day. 2) ftp them to the backup server. 3) At the end of the month make a new directory on my backup server with the new month(eg:Once... (1 Reply)
Discussion started by: koduri0475
1 Replies

5. Filesystems, Disks and Memory

Urgent FTP script automation

Hi guys, Here is my requirement for ftp script that i have to automate in unix using shell script: 1) Find the files that atre created one week from the present day. 2) ftp them to the backup server. 3) At the end of the month make a new directory on my backup server with the new month(eg:Once... (1 Reply)
Discussion started by: koduri0475
1 Replies

6. UNIX for Advanced & Expert Users

FTP script urgent

Hi guys, Here is my requirement for ftp script that i have to automate in unix using shell script: 1) Find the files that atre created one week from the present day. 2) ftp them to the backup server. 3) At the end of the month make a new directory on my backup server with the new month(eg:Once... (1 Reply)
Discussion started by: koduri0475
1 Replies

7. UNIX for Advanced & Expert Users

Script should flow after ftp --Urgent

Hi everyone, The script actually does the ftp and gets the file to the local system. I want to do some manipulations for that file , But after doing ftp , script is not proceding and just a prompt is displayed . .... ftp code here...... .................... ............... echo "FTP... (4 Replies)
Discussion started by: kaaakrishna
4 Replies

8. Shell Programming and Scripting

urgent help needed in telnet issue

Hi, Whenever i am trying to telnet to server i am getting frequent error Authorized Login: prtsrc's Password: /dev/pts/171: Password read timed out -- possible noise on port when i am rerunning the same it is working fine thanks, sam (2 Replies)
Discussion started by: sam99
2 Replies

9. Shell Programming and Scripting

Urgent Telnet Script

hi all, I want to telnet to a port. aand then run a command called 'show threads' once i'm connected to the telnet prompt. then the respond of this 'show threads' i want to store it in a file on a local system. can someone please help me out here? this needs to be scripted, shell script. ... (1 Reply)
Discussion started by: SkySmart
1 Replies

10. Shell Programming and Scripting

URGENT Reading a file and assessing the syntax shell script URGENT

I am trying to write a shell script which takes an input file as an arguement in the terminal e.g. bash shellscriptname.sh input.txt. I would like for the file to be read line by line each time checking if the .txt file contains certain words or letters(validating the syntax). If the line being... (1 Reply)
Discussion started by: Gurdza32
1 Replies
autofsmount(8)						      System Manager's Manual						    autofsmount(8)

NAME
autofsmount - Installs and removes AutoFS intercept points SYNOPSIS
/usr/sbin/autofsmount [-muUv] [-D name=value] [-f master-file] [directory map [-mount-options]] OPTIONS
Defines an AutoFS environment variable by assigning value to the variable. Ignores directory-mapname pairs listed in the auto.master NIS database. Unmounts all AutoFS intercept points and all file systems mounted by autofsd. Unmounts (forcefully) all AutoFS intercept points and all file systems mounted by autofsd. Enables verbose output. Uses master-file for a list of initial directory to mapname pairs, ahead of the auto.master NIS map. If an entry exists in both master-file and auto.master, the one specified in master-file is used since it is read first. Similarly, entries on the command line take precedence over master-file entries. This technique can be used to replace entries in global maps with your own. A fully-qualified path name designates a user-supplied file to read as the master file; otherwise, the name is considered an NIS map name. Specifies the full pathname of a local directory if the map argument is the name of an indirect map or the name of a special map. If the map argument is the name of a direct map, the dummy directory "/-" is specified as the directory. Names a map that the autofsmount command uses to find the mount points and locations. This can either be a file name, an NIS map name, or a special map name. Specifies the mount options to be applied to all of the directories listed in map. If mount options are listed in the specified map, they take precedence over these options. DESCRIPTION
The autofsmount command installs and removes intercept points that are used by the kernel to automatically and transparently mount and unmount NFS file systems. It also removes file systems that were NFS-mounted by the autofsd daemon, if necessary. You can specify AutoFS intercept points in the form of map files. Maps Conventionally, AutoFS maps are files that are located in the /etc directory with names that have the prefix auto. They indicate which remote file systems to mount, where to mount them, and which options to use. An individual AutoFS map is either local or served by NIS. A system, however, can use both local and NIS AutoFS maps. When a map is refer- enced, the autofsmount command checks whether a full pathname is specified. If it is, autofsmount looks for the designated mapname locally. If the mapname is not a full pathname, autofsmount looks for an NIS map by that name. The Master Map The autofsmount program can consult a master map, which contains entries that point to other maps that can be either direct or indirect. If NIS is running, autofsmount checks for the presence of an NIS map named auto.master; you are not required to run NIS or have an auto.master map. A master map can also be a file whose location is specified with the -f command line option. The master map provides AutoFS with a list of maps, and with arguments that pertain to each of the maps. Each line in the master map has the following syntax: directory map [mount-options] Specifies the full pathname of a local directory if the map argument is the name of an indirect map or the name of a special map. If the map argument is the name of a direct map, the dummy directory "/-" is specified as the directory. Names a map that the autofsmount command uses to find the mount points and locations. This can either be a file name, an NIS map name, or a special map name. Lists the options used to regulate the mounting of entries listed in map. Direct Maps Direct maps specify which remote file systems to mount locally and what the local mount points are. They also can specify mount options. Direct maps have the following syntax: key [mount-options] location Specifies the full pathname of the mount point. Lists the options for this specific mount. When present, these options override any mount options specified on the command line or in the master map. Specifies the location of the resource being mounted and uses the format server:pathname. Multiple location fields can be specified; see Replicated File Systems for more information. Indirect Maps Indirect maps have the same format as direct maps. However, unlike the key in a direct map, the key in an indirect map is a simple name that does not begin with a slash. (Remember that the indirect map as a whole has been associated with a directory specified in the master map or on the command line. The entries in an indirect map list subdirectories that are individually mounted within the directory associ- ated with the map.) Special Maps The -hosts map is a special AutoFS map that is used to access all directories exported by a server to a client. The following command allows a client to access directories that are exported from any host in its /etc/hosts file, the NIS hosts database: # autofsmount /net -hosts For example, suppose that hera and sheba are both hosts on a local area network that is running NIS. If superuser on hera enters the autof- smount /net -hosts command, users on hera can access any directories that sheba exports to hera. All of the exported directories are mounted under /net/sheba on hera. Pattern Matching The ampersand (&) is expanded into the key field in a map wherever it appears. In the following example, the ampersand (&) expands to oak: #key mount_options location # oak &:/export/& The asterisk (*), when supplied as the key field, is recognized as the catch-all entry. It is used to substitute for lines that are all formatted similarly. Any entry following the asterisk is ignored. In the following example, the autofsmount program uses the asterisk to match any host name other than oak: #key mount_options location # oak &:/export/& * &:/home/& Environment Variables The value of an environment variable can be used within an autofsd map by prefixing a dollar sign ($) to its name. You can also use braces to delimit the name of the variable from appended letters or digits. The environment variables can be inherited from the environment or can be explicitly defined with the -D command line option. Multiple Mounts A multiple mount entry causes several NFS mount points to be mounted and unmounted together. Multiple mounts have the following syntax: key mountpoint [mount-options] location... [mountpoint [mount-options] location...] ... Specifies the full pathname or simple name of the mount point, depending on whether it is a direct or indirect map entry. Specifies the full pathname of a local directory. All mount points must begin with a slash (/). A slash is acceptable as the first mountpoint. Lists the options for this specific mount. When present, these options override any mount options specified on the command line or in the master map. Specifies the location of the resource being mounted and uses the format server:pathname. Multiple location fields can be specified; see Replicated File Systems for more information. If multiple mounts are hierarchically related, the order in which they appear in the entry is the order in which they are mounted. In the following example, the directories /usr/local, /usr/local/bin, /usr/local/src, and /usr/local/tools are mounted from the machines host1, host2, host3, and host4, respectively. When the root of the hierarchy is referenced, the AutoFS mounts the whole hierarchy. /usr/local / -ro host1:/usr/local /bin -ro host2:/usr/local/bin /src -ro host3:/usr/local/src /tools -ro host4:/usr/src/tools Readability has been improved by splitting the entry into five lines and indenting the continuation lines. Replicated File Systems You can specify multiple locations for a single mount. If a file system is located on several servers and one of the servers is disabled, the file system can be mounted from one of the other servers. This makes sense only when mounting a read-only file system. In the following example, the reference pages can be mounted from host1, machine2, or system3: /usr/man -ro,soft host1:/usr/man machine2:/usr/man system3:/usr/man When you access the reference pages, the autofsd daemon checks to see if the file system can be served locally. For instance, if your sys- tem is a node in the same TruCluster Server cluster, the daemon uses a symbolic link to serve the resource. If the entry cannot be served locally, the autofsd daemon issues a mount request to each server on the list, one at a time, until it finds one that can provide the file system. RESTRICTIONS
Shell filename expansion does not apply to objects that are not currently mounted. You cannot update direct map entries while an active NFS file system is mounted on the designated mount point. You must unmount the NFS file system before the AutoFS mount-update takes effect. AutoFS does not support shared mounts, as defined in automount(8). AutoFS does not support replicated file systems that are specified with the following map syntax, where a list of servers is followed by a colon and the pathname: /usr/man -ro,soft host1,machine2,system3:/usr/man AutoFS does not support map entries that meet all of the following conditions: the directory to be mounted is locally served, no external server is specified for the directory, and the source and target directories would result in circular symbolic links on the system. Fur- thermore, if the directory to be mounted is one of several hierarchically-related map entries, which are normally mounted and unmounted as a group, the group semantic is lost. The file systems are mounted and unmounted on an individual basis. The autofsmount command prints a warning message when it detects these conditions. The autofsmount command does not support the -null command line option of the automount command. EXAMPLES
The following is a sample auto.master map: # # mount-point mapname mount-options # /net -hosts /home auto.indirect -rw /- auto.direct -ro,intr The following is a typical AutoFS indirect map: # # key mount-options location # john merge:/usr/staff/john mary stripe:/usr/staff/mary fred blur:/usr/staff/fred The following is a typical AutoFS direct map: # # key mount-options location # /usr/source -ro merge:/usr/src/proto /usr/local blur:/usr/bin/tools The following is a sample indirect map that specifies multiple mount locations for the file system reference. The file system is mounted from the first server to respond to the mount request. reference -ro earl:/usr/src/ref fern:/usr/staff/ron/ref irv:/usr/backup/reference SEE ALSO
Commands: autofsd(8), automount(8), mount(8) Network Administration autofsmount(8)
All times are GMT -4. The time now is 03:55 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy