Score:0

Netcat files transfer over a private backend 10G network

vn flag

I have a bunch of machines on Ubuntu 20.04 as well as a storage server on Ubuntu 20.04.

I'm looking to transfer quickly files of 100 Gb+ to the storage server with Netcat.

I would like to be able to easily transfer the content of a folder with multiple files without having to name them to a folder on the server.

So far I haven't been successful at using Netcat so I would appreciate if someone could give me simple commands that I could just replicate.

Also tell me how to chose the right ports for the transfer.

Lets's assume that I want to transfer all the files that are in /mnt/disk1/files (only the files, not the folder) on a computer with an IP of 192.168.1.22 to /dev/sdc2/folder1 on a computer with an IP of 192.168.1.30.

Example on the receiving computer I used the following command nc -vl 44444 > /dev/sdc2/folder1 and then on the sending computer I used the following command nc -N 192.168.1.30 44444 < /mnt/disk1/files/* I was told that I had to use * when I wanted to send all the files in a folder but it doesn't work. is port 44444

Nmath avatar
ng flag
Why do you need/want to use netcat? Can you give examples of the commands you are trying and more details about why they aren't working?
in flag
Is mounting a samba share and copying across the network as though it were a local file system insufficient?
vn flag
I need to transfer quickly files that are over 100Gb and samba is way too slow for that. I know for a fact that Netcat is way faster than anything else over a 10G network. I do not want to compress the files as it takes too much time. following my example in my question, on the receiving computer I used the following command nc -vl 44444 > /dev/sdc2/folder1 and then on the sending computer I used the following command nc -N 192.168.1.30 44444 < /mnt/disk1/files/* I was told that I had to use * when I wanted to send all the files in a folder but it doesn't work. is port 44444 ok?
muru avatar
us flag
@OlivierLA75 Just use `tar` without compression.
waltinator avatar
it flag
Please [edit] your post to add new information, properly formatted. Information added via comments is hard for you to format, hard for us to read and ignored by future readers. Please click [edit] and add that vital information to your question so all the facts we need are in the question. Please don't use Add Comment, since that's our uplink to you. All facts about your system should go in the Question with [edit]
ar flag
If you do `nc ... > /dev/sdc2/folder1` you will destroy the 2nd partition of your `sdc` disk! To copy folders and files, you need to copy to a mounted partition, not a raw partition. If you want to use `nc` rather than the usual `rsync` or a mounted NFS or Samba share, then use `tar` as suggested by @muru.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.