TPoly
asked on
FTP script to transfer textfiles
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/\/u sr2/u/ls-2 000/QjobSp ec
# the data you download will be sit under
# /home/student/this/ysw2f01 1//home/st udent/mp3/ chinese
# you can move it up by:
cd /home/student/Desktop//Qjo bSpec
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
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/\/u
# the data you download will be sit under
# /home/student/this/ysw2f01
# you can move it up by:
cd /home/student/Desktop//Qjo
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
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Do you realise , I havent answered your question ?
maybe you have accepted by mistake , you can ask for the question to be unaccepted.
maybe you have accepted by mistake , you can ask for the question to be unaccepted.
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.
if all your text files have ".txt" extension , you can
put
mget *.txt
to download only text files.
ASKER