Tanti Technology

My photo
Bangalore, karnataka, India
Sandeep Kumar | Founder, Tanti Technologies At Tanti Technologies, I share practical knowledge, hands-on tutorials, and real-world solutions across Python, SQL, Docker, Kubernetes, CI/CD, AWS, Azure, Machine Learning, Generative AI, and Agentic AI. My mission is to simplify complex technologies and provide actionable insights that help developers, engineers, and businesses learn faster, build better, automate smarter, and innovate with confidence. 🚀 Learn • Build • Automate • Innovate Follow Tanti Technologies for practical technology insights and next-generation AI solutions.

Monday, 14 April 2014

Script to perform FTP in background



Usually to transfer files from Fix Central to the servers, while downloading to your server it takes lot of time, so during this period we should make sure your network not to disconnect.

To avoid this problem, we can use a script to run this file transfer in background so that, there will be no need for us to be attentive towards the ftp transfer.


Here is the scripttttt




#!/bin/sh
USERNAME="anonymous"
PASSWORD="anonymous"
SERVER="FTP SITE SERVER NAME"
 
# local directory to pickup *.tar.gz file
FILE="/ecc/hsb/H60987058"
 

# login to remote server
ftp -n -i $SERVER <user $USERNAME $PASSWORD
cd $FILE
mget *.*
quit
EOF


- Just put these entries in a file and can be executed as below in background.

Save the content to the file  --> auto-ftp.ksh
Command :   nohup auto-ftp.ksh > /tmp/ftp.out &

- Note: The command has to be executed in a directory where you need to place the download the files!!!

No comments:

Post a Comment