Sponsored Content
Full Discussion: automate an ftp job
Top Forums UNIX for Dummies Questions & Answers automate an ftp job Post 24962 by hassan2 on Monday 22nd of July 2002 02:21:27 PM
Old 07-22-2002
Hammer & Screwdriver

Try

#!/usr/bin/ksh
ftp -v -n "ibm mainframe ip address"
user "user" "passwd"
cd /mainframe directory
lcd /my local_unix directory
bin
mget 111.111.33.333.333
bye


Note:
mget will get a bunch of files .

Do a man mget for more information
 

10 More Discussions You Might Find Interesting

1. Answers to Frequently Asked Questions

Automate FTP / Scripting FTP Transfers

One of our most frequent questions is how to automate ftp transfers. There are several approaches. Since I'm writing this post, we will start with my favorite technique. :) In Automated FTP task I present a simple example of my ksh co-process technique. And note that later in this thread I... (0 Replies)
Discussion started by: Perderabo
0 Replies

2. UNIX for Advanced & Expert Users

Automate FTP

Hi all, I got this piece of code in this forum and I can't seem to get it work. The thread already closed so I just post a new thread. #!/usr/bin/ksh ftp -v -n "YOUR.IP.ADD.RESS" << cmd user "user" "passwd" cd /distant/directory lcd /local/directoryget ssh_install get ( or put) your... (4 Replies)
Discussion started by: CamTu
4 Replies

3. Shell Programming and Scripting

How to automate an FTP process?

Hello script experts, I am newbie to shell script. But I have to write a shell script (ASAP) where I need to ftp a file on daily basis to a remote server, and send an email with final status. I I should have a properties file with hostname, Userid, and pwd. And a shall script file should read... (1 Reply)
Discussion started by: ksak
1 Replies

4. Shell Programming and Scripting

Automate FTP

Hi, Currently, i am using sftp manully to transfer files between two secure servers. Can anyone provide me a sample shell script which can automate the sftp process? (11 Replies)
Discussion started by: borncrazy
11 Replies

5. Shell Programming and Scripting

Automate daily FTP files

How to automate FTP files daily with the following constraints 1) Try (every 15 mins or 30 mins) FTP till it reconnects 2) Files that arrive in between 5:30 pm and 2:00 am 3) The sat and sun, mon files are to be FTP on monday. 4) Only the txt files are to be FTP'ed. The following are the... (2 Replies)
Discussion started by: bobbygsk
2 Replies

6. IP Networking

Automate FTP process and autorestart on link failure

Hi Guys, i have this lil challenge; i am to implement an automated script that searches/scans a directory for files then picks and sends this files to a very remote server via an ftp link. the challenge here is that the ftp link fails due to netwrk issues maybe; i therefore need to develop... (5 Replies)
Discussion started by: sdcoms
5 Replies

7. Shell Programming and Scripting

How to automate ftp in perl

My situations is I cannot use NET::ftp. So I need to have a way to automate ftp. I know how to do it in ksh: #!/usr/bin/ksh ftp -i -v -n $host_name <<_FTP >> $log_file 2>&1 user $user_name lcd $local_dir cd $remote_dir put $file_name bye _FTP But how can I do it in perl? Note:... (6 Replies)
Discussion started by: egyfan
6 Replies

8. UNIX for Advanced & Expert Users

TO Automate the FTP process

Plzz Some One Help in this matter I have scripts to load the data into tables and to copy files from ftp to our system. we use to run the scripts every day.... we hav the files in the FTP server and we hav to bring the files to our system and we hav to load the data into the tables. We... (0 Replies)
Discussion started by: nani1984
0 Replies

9. Shell Programming and Scripting

Automate Job monitoring

Hi, I have a project which i need to automate some manual work. We have a 100 jobs in Linux and Unix environment. We do job monitoring daily. that is taking more that 2 to 3 hrs for us because we use autorep -j <jobname> command for each and every job. That takes more time for us to do. We have... (16 Replies)
Discussion started by: cg_saran
16 Replies

10. Shell Programming and Scripting

Automate [ls]ftp

Heyas Seen some of the ftp posts here and knowing i'll be writing a script using ftp soon, so i thought i'd write a script to automate, or at least simplify some basic tasks with it. I'm currently stuck at handling active/passiv modes. Neither lftp nor sftp seem to support them by arguments,... (3 Replies)
Discussion started by: sea
3 Replies
rcmgr(8)						      System Manager's Manual							  rcmgr(8)

NAME
rcmgr, rc.config - Gets, sets, or deletes runtime configuration variables stored in the files /etc/rc.config, /etc/rc.config.common, and /etc/rc.config.site SYNOPSIS
/usr/sbin/rcmgr [-c | -s] delete variable /usr/sbin/rcmgr [-c | -s] get variable [value] /usr/sbin/rcmgr [-c | -s] mget variable [value] /usr/sbin/rcmgr [-c | -s] set variable value /usr/sbin/rcmgr [-h | -n] [member_number] get variable [value] /usr/sbin/rcmgr [-h | -n] [member_number] mget variable [value] /usr/sbin/rcmgr [-h | -n] [member_number] set variable value /usr/sbin/rcmgr [-h | -n] [member_number] delete variable OPTIONS
The rcmgr command is used with at most one of the options -c, -s, -h, or -n. The options -c and -s are called file options and -h is called the host option. Operations are performed on /etc/rc.config.common, the clusterwide configuration file. Operations are performed on /etc/rc.config.site, the sitewide configuration file. Operations are performed on the /etc/rc.config file for the cluster member whose member ID corresponds to member_number. Operations are performed only on the node-specific file. DESCRIPTION
The rcmgr command retrieves, sets, or deletes runtime configuration variables stored in the hierarchy of configuration files: /etc/rc.con- fig, /etc/rc.config.common, and /etc/rc.config.site. These three files are together referred to as /etc/rc.config*. The runtime variables are used to configure various subsystems (for example, NFS or NTP) via scripts in the /sbin/init.d directory. Caution You should always use rcmgr to make changes to the files. This will preserve the correct syntax in the files. A lock file, /etc/rcmgr.lock prevents multiple access to the data files. These files are used as follows: On a standalone system, configuration variables in both /etc/rc.config and /etc/rc.config.common are used to configure the system. In a cluster, configuration variables defined in the /etc/rc.config.common file are shared by all cluster mem- bers. Because the /etc/rc.config file is defined as a context-dependent symbolic link (and must be maintained as such), there is a distinct /etc/rc.config file for each member in a cluster. The configuration variable settings in any given member's /etc/rc.config file apply only to that member. You can also create a sitewide configuration file named /etc/rc.config.site and distribute it among systems in a local area network or at a particular site. Note that Tru64 UNIX does not ship with such a file. If you decide to use a sitewide configuration file, you must create it, copy it to /etc/rc.config.site on each participating system, and edit each participating system's /etc/rc.config file to include the following command just before the similar line that executes # Read in the cluster sitewide attributes before overriding them # with the clusterwide and member-specific values. # . /etc/rc.config.site # The hierarchy of the /etc/rc.config* files allows an administrator to define configuration variables consistently over all nodes within a local area network and within a cluster. Variables that are the same for all machines on a LAN can be defined in a sitewide file. Variables that are not specific to a given machine and are (or could be) shared by all members of a cluster should be defined in the clusterwide file. Finally, variables specific to a given machine's hardware configuration should be defined in the machine-specific file (or each machine-specific file in a cluster). Command options either search the file hierarchy or operate directly on the the appropriate file as follows: ------------------------------------------------------------------ Option get mget set delete ------------------------------------------------------------------ -s direct direct direct direct -c direct direct direct direct -n direct direct direct direct -h hierarchy hierarchy direct direct Null (no option hierarchy hierarchy hierarchy direct specified) ------------------------------------------------------------------ For example, the -h and -n options do exactly the same thing for set and delete operations. For get and mget operations, the -n option operates only on the the rc.config file. Consider the following command: # rcmgr -h 2 get NUM_TCPD If the variable NUM_TCPD is not defined in the rc.config file, the rcmgr command searches the rc.config.common file next. If the value is found in the rc.config.common file, it is returned. If not, the rcmgr command searches the rc.config.site file. In contrast, you can specify the -n option as follows: # rcmgr -n 2 get NUM_TCPD In this case, if NUM_TCPD is not defined in the rc.config file, then no value is returned and no other files in the hierarchy are searched. The operations are defined in the following section. OPERATIONS
The get operation returns one of the following: the value of variable defined in one of the /etc/rc.config* files, value, or null. If the -coption is specified, the command looks only in the /etc/rc.config.common file. If the -s option is specified, the command looks only in the /etc/rc.config.site file. If the -h member_number option is specified, the command returns the value as defined for the cluster member whose member ID corresponds to member_number. If the -n member_number option is specified, the command looks only in the /etc/rc.config file. The get operation uses a standard search order: it first looks in /etc/rc.config; it then looks in /etc/rc.config.common; finally it looks in /etc/rc.config.site. If no file or host option is specified, the command finds the first definition of variable, using the standard search order. If the variable is not found in any of the files, the command returns value, if specified; otherwise it returns null. If the value of a variable is set to "" (null), then an rcmgr get operation on that variable will return an empty string. With no option specified, the mget operation returns all the variables defined in any of the /etc/rc.config* files, using the standard search order. If a variable is defined in more than one of the files, the first value encountered is returned. If -h member_number is specified, the operation functions identically, except it returns the values as defined for the cluster member whose member ID corresponds to member_number, using the standard search order. If the -n member_number option is specified, the command looks only in the /etc/rc.config file. The values are output one per line in the form variable=value. If no option is specified, the set operation uses the standard search order to set variable to value in the first /etc/rc.config* file in which it finds a definition of variable. If no definition is found, the set is done in the local /etc/rc.config file. If -c or -s is specified, the set is done in /etc/rc.config.common or /etc/rc.config.site, respectively. If -h member_number is specified, the set is done in the /etc/rc.config file for the cluster member whose member ID corresponds to member_number. If no option is specified, the delete operation removes variable from the /etc/rc.config file. The standard search order is not used. If -c or -s is specified, the delete is done in the /etc/rc.config.common or /etc/rc.config.site file, respectively. If -h member_num- ber or -n member_number is specified, the delete is done in the /etc/rc.config file for the cluster member whose member ID corre- sponds to member_number. ERRORS
If there is an error in an argument passed to rcmgr, or if a file option was specified but the file does not exist, rcmgr returns an error message and aborts execution with the exit value 1. EXAMPLES
This example sets the variable HOSTNAME to yukio in the /etc/rc.config file. rcmgr set HOSTNAME yukio This example sets the variable IFCONFIG_0 to 111.111.1.11 netmask 255.255.252.0 in the /etc/rc.config file. rcmgr set IFCONFIG_0 111.111.1.11 netmask 255.255.252.0 This example displays the value of the variable NIS_ARGS in the first definition of NIS_ARGS it finds using the standard search order. If no value is found in any of the /etc/rc.config* files, the command returns null. rcmgr get NIS_ARGS Startup scripts can use the get operation to provide values to variables as in the following examples. This example sets the value of net- devs to the value of MAX_NETDEVS in the /etc/rc.config file on node barney. If no value is defined, it sets netdevs to 24. netdevs=`rcmgr -h barney get MAX_NETDEVS 24` This example sets num_nfsd to 4 if NUM_NFSD is not defined in any of the /etc/rc.config* files. Otherwise, it sets num_nfsd to the value specified in the first definition of NUM_NFSD it finds using the standard search order. num_nfsd=`rcmgr get NUM_NFSD 4` This example deletes the definition of the variable NETDEV_1 from the clusterwide file /etc/rc.config.common. rcmgr -c delete NETDEV_1 FILES
Prevents applications from accessing the data files concurrently, which could cause data corruption. SEE ALSO
System Administration rcmgr(8)
All times are GMT -4. The time now is 05:23 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy