In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-03 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces "how to use ftp timing upload log to other servers", in daily operation, I believe many people in how to use ftp timing upload log to other servers on the problem there are doubts, small make up consult all kinds of information, sort out simple and easy to use operation method, hope to answer everyone "how to use ftp timing upload log to other servers" doubts helpful! Next, please follow the small series to learn together!
Upload logs to other servers regularly using ftp
#!/ bin/bash
#Generation of time
Y=` date --date="-1 hour" +%Y`
m=` date --date="-1 hour" +%m`
d=`date --date="-1 hour" +%d`
H=`date --date="-1 hour" +%H`
#IP address acquisition
IP="`/sbin/ifconfig |grep 'Bcast'|awk -F '[ :]' '{print $13}'`"
#log name generation (varies with time and ip)
LOG_NAME="access-$H-$IP.log"
#FTP Server Address
HOST="10.10.10.170"
#FTP Server User Name
USER="user"
#FTP Server Password
PASS="passwd"
#Upload log files for different projects cyclically
for ROUTE_NAME in "www_log" "h_log" "lpt_log" "c_log" ;do
LCD="/usr/local/nginx/logs/$ROUTE_NAME/$Y/$m/$d"
RCD="/$ROUTE_NAME/$Y/$m/$d"
if [ -f $LCD/$LOG_NAME ] ;then
lftp
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.