Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

FTP script to transfer textfiles

Posted on 2004-09-07
4
Medium Priority
?
312 Views
Last Modified: 2010-04-22
hi..

i would like to ask if it possible for a ftp script to transfer only text files in
the directory and sub directories instead of the whole folder over. The filename of
the text files are unknown before transfering.

if possible can anyone provide some sample.

and also

the ftp script below enables me to transfer the folder over to the remote server
however it keep running in a loop. how can this problem be solved

#!/bin/sh
USER=root
PASSWD=daybreak

cd /home/student/Desktop
# this will get everything under /usr2/u/ls-2000/QjobSpec and place
# it into a folder called rvsi2 which is only created when this
# script is executed
wget -r ftp://${USER}:${PASSWD}@rvsi2/\/usr2/u/ls-2000/QjobSpec
# the data you download will be sit under
# /home/student/this/ysw2f011//home/student/mp3/chinese
# you can move it up by:

cd /home/student/Desktop//QjobSpec
mv QjobSpec /home/student/Desktop
cd /home/student/Desktop

# Remove the files on the remote host.
ftp -n -i rvsi2 <<EOF
user root daybreak
cd /usr2/u/ls-2000/QjobSpec
binary
quit
EOF
exit


thanks
0
Comment
Question by:TPoly
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
4 Comments
 
LVL 11

Accepted Solution

by:
avizit earned 750 total points
ID: 11995079
bas idea to post

#!/bin/sh
USER=root
PASSWD=daybreak

in a public place ( unless ofcourse if they are dummy )
0
 

Author Comment

by:TPoly
ID: 12002348
yupz yupz.. is dummy data
0
 
LVL 11

Expert Comment

by:avizit
ID: 12002571
Do you realise , I havent answered your question ?
maybe you have accepted by mistake ,  you can ask for the question to be unaccepted.
0
 
LVL 11

Expert Comment

by:avizit
ID: 12002580
Btw how do you know which files are text and which files are binary ?
if all your text files have ".txt" extension , you can
put

mget *.txt

to download only text files.
0

Featured Post

[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever been frustrated by having to click seven times in order to retrieve a small bit of information from the web, always the same seven clicks, scrolling down and down until you reach your target? When you know the benefits of the command l…
The purpose of this article is to fix the unknown display problem in Linux Mint operating system. After installing the OS if you see Display monitor is not recognized then we can install "MESA" utilities to fix this problem or we can install additio…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…

596 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question