Home Man
Search
Today's Posts
Register

Open source oftware (OSS) is computer software with source code available with a license. The OSS copyright holder provides anyone the rights to read, modify, and distribute the software for any purpose.

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

« Previous Thread | Next Thread »
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Shell script to copy a file from one server to anther server and execute the binary Nawrajesh Shell Programming and Scripting 1 08-19-2013 04:30 AM
Shell script to monitor new file in a directory and mail the file content neha0785 Shell Programming and Scripting 5 03-19-2013 07:10 PM
How to call mail id from different file in shell script? indira_s Shell Programming and Scripting 3 03-10-2013 11:20 AM
[SOLVED] help clean up file movement script dpreviti Shell Programming and Scripting 2 09-19-2012 02:28 PM
sftp script file movement KAREENA18 Shell Programming and Scripting 5 11-12-2011 10:45 AM
Help with shell script to run the commands reading options from local file itsprout Shell Programming and Scripting 2 06-29-2009 12:26 AM
Can BASH execute commands on a remote server when the commands are embedded in shell bash_in_my_head Shell Programming and Scripting 1 12-04-2008 12:51 AM
Script for automatic deletion of trash file of mail server crown2100bd Solaris 1 09-20-2007 08:01 AM
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 01:53 AM
Conditional File Movement script scheduled using CRON job imu Shell Programming and Scripting 2 09-20-2005 06:30 AM


All times are GMT -4. The time now is 07:47 AM.

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