Results 1 to 3 of 3
Hi guys, how are you all doing? I am currently learning Linux at my work place and have gained good knowledge on using it. However i need some assistance on ...
- 08-04-2010 #1Just Joined!
- Join Date
- Aug 2010
- Posts
- 2
Introduction and Help needed on file transfer!!
Hi guys, how are you all doing? I am currently learning Linux at my work place and have gained good knowledge on using it. However i need some assistance on my assignment from my boss, we are supposed to find out a way of forwarding particular files on our server to particular clients on the network. our network is operating on Linux RedHat. The problem is that the file on the server that has this information to be distributed has all the messages(sub files) concatenated into one file. And this file is dynamic as new messages come in from an out side source. My task is to split up this file on the server into the sub files required by each client, and then forward them to the respective clients.
Thanks a lot.
Best regards,
Derrick S
Last edited by Derrick_Ssebuguzi; 08-04-2010 at 01:52 PM. Reason: make it better
- 08-04-2010 #2
Welcome to the forums!
You post a very open question. I can give you some thought on it, but by no means a definite answer.
Well there are two methods to put a file from one machine to the other. Pushing and pulling. That's one thing to decide upon.
Originally Posted by Derrick_Ssebuguzi
Depending how you decide, you can either use scp (or rsync) to push the files from the server to the clients.
On the other hand, you can create shares on the server and mount those shares from the clients. This has the benefit that you directly control the contents of the share from the server side. This comes into play for example when you have to decide whether to overwrite a file or set a new file besides the old file. The clients then, having mounted the share, can process the files as you wish.
Question, does all this need to be 'real time' or would a periodic sweep be sufficient? (once per day/hour/minute... or a variation thereof)
This is a separate issue. May or may not be difficult. Again, needs it to be real time or periodically? Manual or automatic?
Originally Posted by Derrick_Ssebuguzi
The benefit of using server shares is, you can have this file from the outside source and put it in a local (non-shared) directory. None of the clients can touch it there. We'll call it the source file.
Now you take this source file and put it through some loops and bash-foo and write away the filtered data to the shares where the clients can only access what applies to them.
sourcefile:
client1;11;21;31;41
client2;12;22;32;42
client3;13;23;33;43
client4;14;24;34;44
export directory:
/export/client1
/export/client2
/export/client3
/export/client4
And run:
This is an oversimplification of course. It loops through the first column of the sourcefile (getting the list "client1 client2 client3 client4") and then checks per item if there's a directory in /export corresponding to that item, and then filters out everything that has to do with that item (again, from the list "client1 client2 client3 client4") from the sourcefile and puts it in /export/$item/targetfileCode:for item in `cat sourcefile|cut -d';' -f1` do if [ -d /export/$item ] ; then cat sourcefile|grep $item>/export/$item/targetfile fi done
All the client has to do is mount the share and process the data.
---
When writing this I had an easy solution based on NFS in mind, but that can easily be replaced by rsync with some different benefits and different downsides.Can't tell an OS by it's GUI
- 08-12-2010 #3Just Joined!
- Join Date
- Aug 2010
- Posts
- 2
Help needed on file transfer
Thanx Freston.


Reply With Quote
