just a nice transfer script

Following
#!/bin/bash
#
#
#

og_log_id=$1.log

function og_xml_upp_ftp {
ftp -n << EOF
open server
user (your user)" "
lcd (your directory)
bin
hash
put $og_log_id.gz
bye
EOF
rm (your directory)$og_log_id.gz
}

function og_logs_compess {
cp (your directory)$og_log_id /xtr/log_xfer
gzip /xtr/log_xfer/$og_log_id
}


case $1 in
'xml')
og_logs_compess
og_xml_upp_ftp
;;
'console')
og_logs_compess
og_xml_upp_ftp
;;
'both')
og_log_id=xml.log
og_logs_compess
og_xml_upp_ftp
og_log_id=console.log
og_logs_compess
og_xml_upp_ftp
;;

*)
echo "Usage: $0 (your text)"
exit 1
;;
esac

Comments

Popular posts from this blog

How to set or disable auto-logout on bash shell

How to install PGPool II on PostgreSQL Servers in master-slave architecture + PGPoolAdmin web managment

How to Install Terraform 0.12 on Ubuntu 18.04