Sponsored Content
Full Discussion: ftp nightmare
Top Forums Shell Programming and Scripting ftp nightmare Post 302404835 by soliberus on Wednesday 17th of March 2010 10:45:43 AM
Old 03-17-2010
hi jgt

i was thinking something like this might work:

Code:
# Get list of files on FTP server
ftp -i -n <<EOF > /tmp/filelist.txt
open <hostname>
user <userid> <passwd>
ls
bye
quit
EOF

# Run through the list of files and get, delete each file
for i in `cat /tmp/filelist.txt`
do
  ftp -i -n <<EOF
  open <hostname>
  user <userid> <passwd>
  get $i
  delete $i
  bye
  quit
  EOF
done

Do you think this will work?

It doesn't solve the problem of copying partially uploaded files (thanks for bringing it up).

---------- Post updated at 02:45 PM ---------- Previous update was at 02:21 PM ----------

Okay tried my script, but it didn't work.

It gets a list of file names, but it's not happy with the second part of the script. It fails at the line with "ftp -i -n <<EOF" (inside the "do" bit).
 

8 More Discussions You Might Find Interesting

1. HP-UX

Viewcvs...a nightmare on HP-UX!!!

Hello I'm new on this forum but I have a big problem. I've installed Subversion 1.1.1 and Apache 2.0.52 on a HP-UX. This is the uname: HP-UX xxxx B.11.11 U 9000/800 4169945236 unlimited-user license Now I must to install a software to browse the svn repositories. My choice is Viewcvs. ... (3 Replies)
Discussion started by: goblin79
3 Replies

2. Shell Programming and Scripting

Splitting Chunked-FullNames Nightmare

I've got a problem i'm hoping other more experienced programmers have had to deal with sometime in their careers and can help me: how to get fullnames that were chunked together into one field in an old database into separate more meaningful fields. I'd like to get the records that nicely fit... (2 Replies)
Discussion started by: RacerX
2 Replies

3. UNIX for Dummies Questions & Answers

installing apache (nightmare for me)

Please help... i'm new to this job and new to unix as well..... i'm trying to install apache 2.2.6 it's installed on one server... i need to install it on another server... my clue was to maybe use the fetch command... please help.....for example..... apache is on 69.50.132.14.... and it needs to... (1 Reply)
Discussion started by: marinob007
1 Replies

4. UNIX for Dummies Questions & Answers

is unix really such a nightmare... or is it me?

i rue the day that my server manager and i parted company... the start of a long journey.... :( sometimes i find myself daydreaming about the days when i could say... "this dont work, can u fix it?".... and 2 mins later it worked! i have a new way of "cursing" at ppls.... i just say "failed... (10 Replies)
Discussion started by: mickeymouse
10 Replies

5. BSD

FreeBSD nightmare!!!

Dear friends out there, i hope u'll have enough time to read this problem of mine and try to help me solve it. well, i've been a long time user of microsoft products and happened to come across FreeBSD when one fellow referred me to it saying that it was a wonderful OS which one could use for web... (6 Replies)
Discussion started by: kenyatta
6 Replies

6. Solaris

date -d nightmare on Solaris

Hello there ppl, I thought my question would qualify to be posted in this forum and in Shell scripting forum. And I swear to God.. there is no discussion on this exact topic anywhere else on the web! So my script on BASH uses 2 commands: 1) date -d "Fri Mar 06 10:18:16 UTC 2009" +%s ... (1 Reply)
Discussion started by: pavanlimo
1 Replies

7. UNIX for Advanced & Expert Users

Virtualizing SCO v5 - interesting project/nightmare, could use some help

same old story, we have an important very old app running on SCO 5, box is only on LAN and as such was never updated by anyone etc.. box is nearing its end of life in a bad way (currently experiencing some SCSI issues) and it's time to do something when good advice of "lets upgrade" for years was... (1 Reply)
Discussion started by: mc18
1 Replies

8. Solaris

AI server corporate nightmare

Hello Ex-Sun fellows, i've been tasked to install a bran spanking new AI Solaris 11.1 server for our Oracle park. With the documentation this is what's running and what's working. T5120 2 oracle VM's (one ldom on each disk) One with a Solaris 11.1 repo, AI server. One for testing... (0 Replies)
Discussion started by: maverick72
0 Replies
ftpconfig(1M)						  System Administration Commands					     ftpconfig(1M)

NAME
ftpconfig - set up anonymous FTP SYNOPSIS
ftpconfig [ftpdir] ftpconfig -d ftpdir DESCRIPTION
The ftpconfig script is executed by the super user to set up anonymous FTP. Anonymous FTP allows users to remotely log on to the FTP server by specifying the user name ftp or anonymous and the user's email address as password. The anonymous users are logged on to the FTP Server and given access to a restricted file area with its own file system root. See chroot(2). The FTP area has its own minimal system files. This command will copy and set up all the components needed to operate an anonymous FTP server, including creating the ftp user account, creating device nodes, copying /usr/lib files, and copying timezone data. The passwd and group files set up have been stripped down to prevent malicious users from finding login names on the server. The anonymous file area will be placed under ftpdir. If the ftp user account already exists, then the current FTP area is used, and the system files in it are updated. All other files are left untouched. This command should be run to update the anonymous FTP area's configuration whenever a system patch is installed, or the system is upgraded. OPTIONS
-d Create a new or update an existing ftpdir without creating or updating the ftp user account. Use this option when creating guest FTP user accounts. OPERANDS
The following operands are supported: ftpdir The absolute pathname of the directory under which the anonymous FTP area is set up. EXIT STATUS
The following exit values are returned: 0 Successful completion 1 Improper usage of the command 2 Command failed ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWftpu | +-----------------------------+-----------------------------+ |Interface Stability |Evolving | +-----------------------------+-----------------------------+ SEE ALSO
ftpaddhost(1M), in.ftpd(1M), useradd(1M), chroot(2), attributes(5) SunOS 5.10 1 May 2003 ftpconfig(1M)
All times are GMT -4. The time now is 01:21 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy