Based on what I have read so far and what others have posted on this forum, I have come up with the following script to download and upload files from and to a FTP sever:
As you can see, after I perform "mget", I am trying to get a list of the XML files that were downloaded so that I can delete them from the remote FTP server and move them to the $indir on the local server. However, the "ls $inholddir/*.xml > $tmpfile 2>/dev/null" command generates no output even though files were sucessfully downloaded and are present in the $inholddir directory. I am not sure why. Can someone point me in the right direction?
Thanks!
PS: The reason I want to get a list of the downloaded files and then delete each file individually is because there is a possibility of new files appearing in the remote "Download" directory while the mget and/or the delete is in process (potential "timing" issue). In such cases, I don't want to delete files that have not been downloaded yet.
for ftp mget to work without a prompt and answer you need: ftp -inv
-i turns off prompting for mput and mget as each file is processed.
Well, the issue I am having is not with the prompting but with getting a list of all the XML files after they were downloaded to the local server using mget. So as soon as mget executes to download lets say 10 files in the $inholddir directory on the local server, I am running this command:
ls $inholddir/*.xml > $tmpfile 2>/dev/null
However, $tmpfile contains nothing even though there are files in the $inholddir (that were downloaded from the remote server).
I just started a new semester and I started my UNIX class yesterday. I've already decided to use python along with my learning process but what I really want to use with it is Kali as my UNIX/Linux platform to learn off of since I already wanted to learn Cyber Sec. anyways. I just wanted to know if... (12 Replies)
RHEL 5.4
Our Linux machine seemed to be running slow. So, I ran the top and vmstat commands.
Question1.
I can see the process 11517 consuming 100% CPU . But that just means that this process totally utilizes one of the cores in a mult-core CPU. Right ? This machine apparently has two... (2 Replies)
Hi Guys,
I want to some guidance from you in setting up the Live FTP server in Redhat Linux 6 with Static IP
120.50.150.50.
Now should I set my Static Public IP directly to my Linux machine?
If so what whould be my sunbet mask?
Is any type of natting required here? if so where would... (2 Replies)
Hi guys, wondering if you could help me out here...
this is a proxy system problem
I'm trying to access a web gui service off a linux box running Red Hat Linux release 9 (Shrike) used as a proxy server which does not seem to have a web browser installed.....
how can i do this?
so to... (2 Replies)
Hello there!
Will anybody please tell me some good links to online eBooks on Red Hat Linux 9 user experiences and the like. If the books are in PDF Format, it will be nice to read.
Thanks for cooperation in advance.
Enjoy using open source and breathe freely!
JAM (5 Replies)
I have setup a AS 2.1 server with no X running or installed. I need to know how to configure the IP and such from command line and change it from DHCP. We used DHCP at first since we didn't know the IP we were going to use and now I need to change it. Any help would be great as Redhat's site just... (2 Replies)
I have just installed RH7.2 Server and along with apache 1.3 and PHP. I am able to FTP from my linux box to other remote maches, but am unable to FTP to the linux box from other remote machines. The message I get is: A remote host has refused an attempted connect operation. I have done some... (3 Replies)
Hi everyone,
I Just finished installing Red Hat 7.1 server, and I am having a problem with FTP, and Telnet. I can FTP and Telnet to all client stations. But cannot FTP and Telnet to the server. Does any one know what i missed. All client hosts are in the etc/hosts already. (2 Replies)
Ok here is my problem i do not know the command to load a driver for my network card in Ted hat linux 6.0 could sombody give me a hand. and if there is anyone that has a list of commands for red hat that would be great also (2 Replies)