FTP_Automation_Issue


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting FTP_Automation_Issue
# 1  
Old 07-18-2014
FTP_Automation_Issue

I have a made a script to move a logs from my source server to a target server.
Code:
#! /usr/bin/ksh
year=`date +%y`
month=`date +%m`
day=`date +%d`
direc=`date +%d%m%y`
echo "backup_script_started `date`" > /BKUP/complete_$direc.txt
cd /BKUP/`date +%d%m%y`
/usr/bin/gzip /BKUP/`date +%d%m%y`/*.* 

ftp -v -n 172.12.12.14 <<INPUT

user root root_123 1
bin
prompt
cd /log1/Backups
mkdir $direc
cd /log1/Backups/$direc/
mkdir log_$direc
cd /log1/Backups/$direc/log_$direc
mput *.gz
quit
INPUT
echo "backup_script_ended at `date`" >> /BKUP/complete_$direc.txt

In this script i am facing some issue , the ftp is happening successfully but i am not able to get the directory created with the date. mkdir command is not getting executed successfully , whereas if i login manually the mkdir command is working.

This script is failing some where and couldn't crack it.

Need advice

Last edited by Scott; 07-18-2014 at 03:16 AM.. Reason: Code tags
# 2  
Old 07-18-2014
Can you capture and review the output from the ftp command:-
Code:
ftp -v -n 172.12.12.14 <<INPUT > /tmp/ftp_log 2>&1

user root root_123 1
bin
:
:

If they don't make sense, could you post them here wrapped in [CODE] & [/CODE] tags for clarity.



Thanks, in advance,
Robin
Login or Register to Ask a Question

Previous Thread | Next Thread
Login or Register to Ask a Question