Reputation: 83
I have a system, Having 2 separate boards running Linux on it, Connected to each other over IP. The main board is connected to the Internet but the other/slave board can not connect to the internet. Slave board is running a FTP server which is accessible to main board.
There is one file on Internet server/Cloud for the slave board, which I want to download directly on Slave board storage. So I need a mechanism on the main board, which will download the file from the Internet & transfer/stream it directly on the SlaveBoard FTP in chunks. I can not download entire file on main board & at the end transfer to slave board as I don't have enough space on the main board to store entire file on its local storage.
[Edit] Main board will act as moderator.
How to achieve this using Curl APIs in C application? Is there any mechanism already available to achieve this? Will appreciate any lead in this. Thanks in advance.
Upvotes: 0
Views: 1183
Reputation: 2517
I would have used NFS share or RSYNC sharing from slave board where I have storage.
Prefer NFS over RSYNC but as per your use case , resources and expertise choose.
NFS server. create NFS server on slave board. mount that share on main board and download in this share. those downloaded files will be stored on slave board.
RSYNC another option install rsync on both machine
rsync -rt rsync://[email protected]:873/files/ /home/pulledfromdaemon
once copy is successful you can delete files in main board.
don't use --delete flag which removes files when deleted from source.
Upvotes: 1