Sponsored Content
Full Discussion: FTP in UNIX
Top Forums Shell Programming and Scripting FTP in UNIX Post 302676835 by jim mcnamara on Wednesday 25th of July 2012 07:18:54 AM
Old 07-25-2012
Code:
# $1 == filename
HOST='xxxx'
USER='xxxxx'
PASSWD='xxxxxx'
# find out if the file is on the remote box
ftp -i -n $HOST << START > /tmp/chk
user ${USER} ${PASSWD}
binary
cd /home/xxxx/xxxx
dir ${1}
quit
START
# this looks to see if remote file was found  otherwise exit early
[ grep -fq 'test' /tmp/chk ]  || exit
ftp -i -n $HOST << START
user ${USER} ${PASSWD}
binary
cd /home/xxxx/xxxx
get ${1}
quit
START

This does what you ask but is not efficient.
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

ftp from unix to pc

Hi All, How can I get a file as soon as generated into the unix server, it should get transferred into my pc? my pc connected to novell, and I know the ip address of my pc and unix server. reply to : ::email removed:: regards krishna (2 Replies)
Discussion started by: krishna
2 Replies

2. UNIX for Advanced & Expert Users

ftp from NT to UNIX

PROBLEM !!!!!!! I have files that is on a NT machine. It is located in a directory with subdirectories underneath it. TAR can not be used. I need to use a normal ftp command script to transfer these files from NT to UNIX, or get it from the UNIX machine, including the subdirectories. It must... (5 Replies)
Discussion started by: wolf
5 Replies

3. Shell Programming and Scripting

FTP script for sending a file from one unix directory to another unix server director

Hi, My local server is :/usr/abcd/ Remote server is :/Usr/host/test/ I want to send files from local unix directory(All files starting with O_999) to remote host unix directory. Can any body give me the Unix Shell script to do this. One more doubt: Shall we need to change the file... (1 Reply)
Discussion started by: raja_1234
1 Replies

4. UNIX for Dummies Questions & Answers

Pc to unix ftp

Hello guys..I am new to Unix, I am trying to transfer a .txt file from my windows PC to my Unix account at school using ftp. I am kind of stuck, can anybody explain to me the steps to do this? (1 Reply)
Discussion started by: Aristo
1 Replies

5. Shell Programming and Scripting

FTP script to FTP file to UNIX - Solaris

Hello, A couple of times per week, i receive emails notifications when files are available for processing. Currently i read these eamails with a java program and store the attachement on my C: drive and would now like to generate a PC script to send this file name up to UNIX-Solaris and... (3 Replies)
Discussion started by: bobk544
3 Replies

6. UNIX for Advanced & Expert Users

MVS->Unix FTP : Using chmod as part of FTP.

We are transferring file from mainframes to unix, & in FTP process itself we would like to set access rights for unix machine. Has anyone used chmod command in association with site command in ftp? How it should be used? Thanks in advance. (1 Reply)
Discussion started by: videsh77
1 Replies

7. Shell Programming and Scripting

ftp from windows to unix using a perl script on unix machine

i need to ftp a file from windows to a unix machine by executing a sript(perl/shell/php) from that unix machine.i can also use HTML and javascript to build forms. (3 Replies)
Discussion started by: raksha.s
3 Replies

8. Shell Programming and Scripting

UNIX script to FTP file from UNIX server to windows

Hi, I am new to this subject.....Can someone please help me out with the script... unix usernm "sdhftst" unix pwd "chsd13" windows usernm "dfghtst" windows pwd "chsd13" path..../xxx/xxxxx/xxxxxx/xxxxxxx please can u get me a script...its only one file to get ftp. Thanks... (2 Replies)
Discussion started by: himakiran9
2 Replies

9. Shell Programming and Scripting

FTP from windows to unix server using unix shell script

Hi, Is it possible to ftp a huge zip file from windows to unix server using unix shell scripting? If so what command i need to use. thanks in advance. (1 Reply)
Discussion started by: Shri123
1 Replies

10. UNIX for Beginners Questions & Answers

Help with FTP in UNIX

Hi All, I am a beginner in Unix, wanted to know can we FTP one file located in one server to the another server location using Putty. The destination would require user ID and password to access the location. Also, the file that needs to be picked up should have the date of previous day. ... (1 Reply)
Discussion started by: richa shukla
1 Replies
qmail-command(8)                                              System Manager's Manual                                             qmail-command(8)

NAME
qmail-command - user-specified mail delivery program SYNOPSIS
in .qmailext: |command DESCRIPTION
qmail-local will, upon your request, feed each incoming mail message through a program of your choice. When a mail message arrives, qmail-local runs sh -c command in your home directory. It makes the message available on command's standard input. WARNING: The mail message does not begin with qmail-local's usual Return-Path and Delivered-To lines. Note that qmail-local uses the same file descriptor for every delivery in your .qmail file, so it is not safe for command to fork a child that reads the message in the background while the parent exits. EXIT CODES
command's exit codes are interpreted as follows: 0 means that the delivery was successful; 99 means that the delivery was successful, but that qmail-local should ignore all further delivery instructions; 100 means that the delivery failed permanently (hard error); 111 means that the delivery failed but should be tried again in a little while (soft error). Currently 64, 65, 70, 76, 77, 78, and 112 are considered hard errors, and all other codes are considered soft errors, but command should avoid relying on this. ENVIRONMENT VARIABLES
qmail-local supplies several useful environment variables to command. WARNING: These environment variables are not quoted. They may con- tain special characters. They are under the control of a possibly malicious remote user. SENDER is the envelope sender address. NEWSENDER is the forwarding envelope sender address, as described in dot-qmail(5). RECIPIENT is the envelope recipient address, local@domain. USER is user. HOME is your home directory, homedir. HOST is the domain part of the recipi- ent address. LOCAL is the local part. EXT is the address extension, ext. HOST2 is the portion of HOST preceding the last dot; HOST3 is the portion of HOST preceding the second-to-last dot; HOST4 is the portion of HOST preceding the third-to-last dot. EXT2 is the portion of EXT following the first dash; EXT3 is the portion following the second dash; EXT4 is the portion following the third dash. DEFAULT is the portion corresponding to the default part of the .qmail-... file name; DEFAULT is not set if the file name does not end with default. DTLINE and RPLINE are the usual Delivered-To and Return-Path lines, including newlines. UFLINE is the UUCP-style From_ line that qmail- local adds to mbox-format files. SEE ALSO
dot-qmail(5), envelopes(5), qmail-local(8) qmail-command(8)
All times are GMT -4. The time now is 05:12 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy