- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: FTP Script to transfer transaction log backup ...
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-31-2011 02:23 AM
01-31-2011 02:23 AM
I need to transfer archive log files between 2 HP-UX servers. Every 10 min the FTP schedule script will run. So that if file is available
script will ftp the file. And also script should have logic of sending the latest archive log files of last FTP script run, So that the script will send only the latest files when script again run at schedule time.
And also before the script run it should check whether this ftp script is already running, If script is already running then it should not run the FTP script again.
Please let me know how to modfiy the FTP script below to have the above requirement.
#!/bin/ksh
cd /directory/Outbound
HOST='ftp.test.com'
USER='unix'
PASSWD='unix'
ftp -n -v $HOST << EOF
user $USER $PASSWD
lcd /directory/Outbound
cd upload
bin
prompt
mput *.LOG
EOF
Thanks,
Narendra
Solved! Go to Solution.
- Tags:
- ftp
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-31-2011 03:21 AM
01-31-2011 03:21 AM
Solution#!/bin/ksh
if [ -f /tmp/.ftpbusy ]
then
echo "Busy by a previuos ftp proccess"
else
touch /tmp/ftpbusy
cd /directory/Outbound
HOST='ftp.test.com'
USER='unix'
PASSWD='unix'
ftp -n -v $HOST << EOF
user $USER $PASSWD
lcd /directory/Outbound
cd upload
bin
prompt
mput *.LOG
EOF
rm /tmp/.ftpbusy
fi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-31-2011 04:05 AM
01-31-2011 04:05 AM
Re: FTP Script to transfer archive log files between 2 HP-UX servers.
Previous post aviods overlapping of processes using a file control (/tmp/.ftpbusy). Use a convenient place to create it.
To controls lastest log files you could rename them to a sent extention (i.e: .LOG.SENT), once the mput command have been done. Or move them to a sent log directory once sent them (mv *.LOG /anywhere). By this way you just have the last files to send when you execute mput *.LOG.
Rgds.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-31-2011 09:03 AM
01-31-2011 09:03 AM
Re: FTP Script to transfer archive log files between 2 HP-UX servers.
As log files are generated incremental by one i.e. LOG.001,LOG.002,LOG.003. Can we have a logic to check which log files are transfer base on log sequence number so that next time it will send only the logs which were not earlier sent.
Thanks,
Narendra
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-31-2011 10:21 AM
01-31-2011 10:21 AM
Re: FTP Script to transfer archive log files between 2 HP-UX servers.
Given that your logfiles are named in the format "LOG.001, LOG.002, LOG.003", etc. to find the next name to use, you could do something like:
# cat ./nextlog
#!/bin/sh
LAST=$(ls -r LOG.*|head -1|sed -e 's/LOG.//')
[ ${LAST} = 999 ] && LAST=0
LAST=$(( LAST+1 ))
NEXT=$(printf "LOG.%03d\n" ${LAST})
echo ${NEXT}
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-31-2011 10:32 AM
01-31-2011 10:32 AM
Re: FTP Script to transfer archive log files between 2 HP-UX servers.
A lower band width alternative might be to use rsync to copy files between servers. rsync, available from Internet Express on http://software.hp.com has options to only copy over files that have changed, and not bother recopying the entire set of files.
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-06-2015 02:19 AM - edited 10-06-2015 02:21 AM
10-06-2015 02:19 AM - edited 10-06-2015 02:21 AM
Re: FTP Script to transfer transaction log backup files between 2 HP-UX servers from DC to DR server
Can anybody let me know the shell script to transfer sybase ase transaction log backup files between 2 HP-UX servers i.e. Primary site to DR site?
I need full script to schedule it from Primary server which will transfer these files to DR.
Later , i need to schedule it using crontab.
Regards,
DK
@Jose Mosquera wrote:
#!/bin/ksh
if [ -f /tmp/.ftpbusy ]
then
echo "Busy by a previuos ftp proccess"
else
touch /tmp/ftpbusy
cd /directory/Outbound
HOST='ftp.test.com'
USER='unix'
PASSWD='unix'
ftp -n -v $HOST << EOF
user $USER $PASSWD
lcd /directory/Outbound
cd upload
bin
prompt
mput *.LOG
EOF
rm /tmp/.ftpbusy
fi
@Jose Mosquera wrote:
#!/bin/ksh
if [ -f /tmp/.ftpbusy ]
then
echo "Busy by a previuos ftp proccess"
else
touch /tmp/ftpbusy
cd /directory/Outbound
HOST='ftp.test.com'
USER='unix'
PASSWD='unix'
ftp -n -v $HOST << EOF
user $USER $PASSWD
lcd /directory/Outbound
cd upload
bin
prompt
mput *.LOG
EOF
rm /tmp/.ftpbusy
fi
@Jose Mosquera wrote:
#!/bin/ksh
if [ -f /tmp/.ftpbusy ]
then
echo "Busy by a previuos ftp proccess"
else
touch /tmp/ftpbusy
cd /directory/Outbound
HOST='ftp.test.com'
USER='unix'
PASSWD='unix'
ftp -n -v $HOST << EOF
user $USER $PASSWD
lcd /directory/Outbound
cd upload
bin
prompt
mput *.LOG
EOF
rm /tmp/.ftpbusy
fi