ftp problem on bash script

a bv vbavbalist at gmail.com
Fri Dec 10 13:52:22 UTC 2010


Hi Im trying to write a bash script which will run on Checkpoint
Secureplatform (which is
Redhat indeed) seems below. First part of the script will make an
yesterdays log archive ,
other part will  copy this archive to an ftp server. The archive
creation process works fine when ftp part is commented or deleted, but
doesnt work. As one script or another script for ftp, how can i work
this to create the archive and and copy it to the ftp site.

Regards


# !/bin/sh

# Define string variables!
hostname="intsrvb.abank.com.tr"
ftp_server="myserver"
ftp_username="myuser"
ftp_password="mypassword"
cpdir=/opt/CPshrd-R70
localbakdir=/opt/CPsuite-R70/fw1/log/
remotebakdir=/tape/2010tape/log/omega/cp/
logdate=`/bin/date --date="yesterday" +%Y-%m-%d`
logname=${logdate}
archivedate=`/bin/date --date="yesterday" +%Y_%m_%d`
archivename=logs_${hostname}_${archivedate}

# Set Check Point profile for library settings!
. $cpdir/tmp/.CPprofile.sh


# Archive yesterday`s log files!
cd ${localbakdir}
/bin/tar zcf ${localbakdir}${archivename}.tgz ${logname}*

# FTP files to backup server!
#ftp -in $ftp_server <<EOC
#user  myuser mypassword
#binary
#cd ${remotebakdir}
#lcd ${localbakdir}
#put ${archivename}.tgz
#bye




More information about the redhat-list mailing list