![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Copying files from a remote server to local system with cygwin | patwa | UNIX for Dummies Questions & Answers | 3 | 06-12-2008 08:49 AM |
| Find match in two diff file - local srv and remote server | amir07 | Shell Programming and Scripting | 0 | 03-07-2008 10:23 AM |
| Transfer file from local unix server to remote server | indira | Shell Programming and Scripting | 2 | 05-03-2007 07:35 AM |
| Transfer file from local unix server to remote server | indira | HP-UX | 2 | 05-02-2007 06:15 PM |
| executing a remote location script from local server | srivsn | Shell Programming and Scripting | 2 | 02-28-2006 03:16 PM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
FTP multiple files from remote server to local server
Hi,
I am facing a weired problem in my FTP script. I want to transfer multiple files from remote server to local server everyday, using mget * in my script. I also, want to send an email for successful or failed FTP. My script works for file transfer, but it don't send any mail. There is somthing wrong with mailx option, I don't know what. If I use the FTP part of the script like below, mailx works fine, but then mget is not working (only get is working) and no files are transfered. `ftp -vin <<- END_INPUT > $LOG/ftp_files.log 2>&1 open $DEVICE user $LOGIN $FTPPASS cd $PICKUP prompt off mget *.txt quit END_INPUT` The original script is below: #!/bin/ksh export DROPOFF=/data/local/temp export PICKUP=/data/remote/temp export MSG=/data/local/temp export IND_FILE=/data/local/temp export LOG=/data/local/temp export LOGIN=username export FTPPASS=password export DEVICE=remoteserver cd $DROPOFF ftp -vin <<- END_INPUT > $LOG/ftp_files.log 2>&1 open $DEVICE user $LOGIN $FTPPASS cd $PICKUP prompt off mget *.txt quit END_INPUT EXIT_STATUS=$? if [ $EXIT_STATUS -ne 0 ] then echo "[%s - %s]ERROR: FTP failed with an exit status of %s\n" \ %0 "$(date +'%x %X')" $EXIT_STATUS mailx -r mlqis4s@server.private.company.com -s \'"Files FTP failed'" user@company.com < $MSG/ftp_fail.msg exit 1 fi echo mailx -r mlqis4s@server.private.company.com -s \'"Files FTP successful'" user@company.com < $MSG/ftp_succ.msg exit 0 Please anybody have a clue to solve that? Thanks in advance! |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|