Shell script file movement to a Mail Box server using ftp commands

Tags
ftp from unix to mailbox

Login to Reply

 
Thread Tools Search this Thread
# 1  
Old 03-03-2015
Shell script file movement to a Mail Box server using ftp commands

Hi All,

I have a current Process that runs "windows script " for the file movement that needs to changed to a "DataStage Process (Using shell script )"

Source :Text file is getting generated as part of Datastage Jobs processes and resides in a shared drive (Unix server)

Target :ftp hostname "xxx.yyy.com " folder "ABC" is a mailbox location

Current Process :

Currently It is using following windows script to move the file

Code:
open xxx.yyy.com 
user name 
password 
prompt 
put "\\psoft8\output\FILE.TXT"%ABC%FILE 
quit

Can you please help me with FTP command OR syntax used for this file movement.

Thank you
# 2  
Old 03-03-2015
\\psoft8 looks like a samba (SMB) windows file share. In order to open that file on UNIX you have to install samba. So, something is missing. You can ftp from windows to UNIX, no problem.

So instead of showing us a code fragment that is of very little help:

1. Is this from windows to UNIX?
<your answer here>
2. Can it (the ftp part at least) run on Windows or does the script have to live on UNIX?
<another answer please>
3. Can the UNIX box see \\psoft (or whatever its name is on UNIX, maybe /psoft8) now? <yes or no>
# 3  
Old 03-05-2015
@Jim ..Thanks for the reply sorry for the confusion.

[\\psoft8]this is the windows server and Is OBSELTE NOW .. the proposed process is to place the file from unix server to Mail box location ftp server .

Responses :
1. Is this from windows to UNIX?
No ..this is from unix server to mail box location (ftp host)
2. Can it (the ftp part at least) run on Windows or does the script have to live on UNIX?
Script has to be reside on UNIX server ..Script has to be executed from DataStage Execute command Activity stage ..This stage takes the "FTP.sh " and Properties for the script.
3. Can the UNIX box see \\psoft (or whatever its name is on UNIX, maybe /psoft8 ) now? <yes or no>
No ..\\psoft is OBSELTE now

This is basic script I wrote to get the file from that mail box server

Code:
#!/usr/bin/bash 
#------------------------------------------------------------------------------------ 
# Name        : FTP.sh                                 
#---------------------------------------------------------------------------------------------------------------------------# 
HOST= 'xxx.yyy.com' 
user ='aaaa' 
password='bbbb' 

ftp xxx.yyy.com 
user $user $password 
get 00123456789 
quit 
END_SCRIPT 
Exit 0

Findings from Windows command prompt :

Code:
Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation.  All rights reserved.

C:\Users\X>ftp xxx.yyy.com
Connected to xxx.yyy.com.
220 Enterprise FTP server (Version 1.0.0 Nov. 5, 1996)
User (edi.cat.com:(none)): aaaa
331 Password required for aaaa
Password:
230-User logged in, proceed.
        Current Default Relationship - Recv: aaaa uuuu: *BINARY
        Get option: multiple
230
ftp> dir
200 Port command successful.
150 Opening ASCII mode data connection for transfer
Mailbox ID          St  APRZ           SYRF           Service Refs. #
abc                    N   SMAR          file123             00123
abc                    N   SMAR          file456             00456
226 Transfer Complete.
ftp: 2319 bytes received in 0.04Seconds 52.70Kbytes/sec.
ftp> get SMAR
200 Port command successful.
150 Opening ASCII mode data connection for transfer
226- 30 documents are received
226 Transfer complete.
ftp: 28687325 bytes received in 35.06Seconds 818.17Kbytes/sec.
ftp> lcd
Local directory now C:\Users\X.
ftp> get file321
200 Port command successful.
226- 0 documents are received
226 Transfer complete.
ftp> get 00123
200 Port command successful.
150 Opening ASCII mode data connection for transfer
226 Transfer complete.
ftp: 962245 bytes received in 0.31Seconds 3144.59Kbytes/sec.
ftp>

Login to Reply

|
Thread Tools Search this Thread
Search this Thread:
Advanced Search

Similar Threads More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Copying , renaming the file from windox box and ftp to Linux box umesh yadav How to Post in the The UNIX and Linux Forums 1 03-10-2015 02:46 PM
Download latest file via ftp server unix through shell script ajju Shell Programming and Scripting 3 03-23-2014 11:06 PM
Commands not executing after FTP in shell script Pratik4891 Shell Programming and Scripting 1 04-13-2012 03:40 AM
How to FTP the latest file, based on date, from a remote server through a shell script? imran_affu Shell Programming and Scripting 9 03-08-2011 02:05 PM
Send mail from redhat box to exchange server oguzhantrg Red Hat 1 05-24-2010 04:58 AM
ftp file starting with particular name on Windows box to Unix box using shell script vijayb4u83 Shell Programming and Scripting 2 05-19-2009 12:37 AM
How to use ftp commands inside shell script? Help please Dendany83 Shell Programming and Scripting 4 04-06-2009 01:58 PM
Shell script for FTP a file from one server to another server mahantysk Shell Programming and Scripting 0 09-17-2008 07:22 AM
Configuring Linux box with the smtp mail server amit_kv1983 UNIX for Advanced & Expert Users 4 09-05-2008 03:42 AM
How to configure Linux box with my SMTP mail server amit_kv1983 UNIX for Advanced & Expert Users 1 09-04-2008 03:50 AM
Shell Script to ftp from windows server shilpa.rajput Shell Programming and Scripting 8 11-07-2007 12:52 AM
FTP Unix Box to Windows Shell Script Jose Miguel Shell Programming and Scripting 2 07-11-2007 03:30 PM
concurrency issue while Accessing Mail Box from shell script Sumit_Fundoo UNIX for Advanced & Expert Users 2 02-25-2007 02:23 PM
how to move a file from one server to another server using FTP in shell script? forevercalz Shell Programming and Scripting 4 10-27-2005 02:53 AM
How to FTP a file generated at UNIX Box to NT Box Ruchir UNIX for Advanced & Expert Users 2 08-11-2005 06:55 AM
All times are GMT -4. The time now is 09:05 AM.

Unix & Linux Forums Content Copyright 1993-2018. All Rights Reserved.
UNIX.COM Login
Username:
Password:  
Show Password





Not a Forum Member?
Forgot Password?