LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-19-2015, 08:19 AM   #1
tripialos
Member
 
Registered: Apr 2012
Posts: 166

Rep: Reputation: Disabled
file copy with netcat missing


Hi everyone

long story short

i copied a file using netcat from one server to another but the file is not in the location it should be.

Curently i have a "find" command running in order to get the file but the disk is 3Tb and will take ages till it finds it.

Is there any other way i could figure out where this file is?

Can i repeat the copy procedure with netcat and while the copy is in progress to find out where the file is? maybe with some sort of "lsof"

Maybe verbosing netcat?

Thanks
 
Old 03-19-2015, 08:35 AM   #2
michaelk
Moderator
 
Registered: Aug 2002
Posts: 15,738

Rep: Reputation: 1753Reputation: 1753Reputation: 1753Reputation: 1753Reputation: 1753Reputation: 1753Reputation: 1753Reputation: 1753Reputation: 1753Reputation: 1753Reputation: 1753
Post the exact command the was used on the receiving machine. Also look at the command history on the receiving machine to see if any cd commands were used that might indicate the last working directory. Yes, it might be simpler to repeat the copy and make sure cd to the desired directory before initiating the receive command.
 
Old 03-19-2015, 08:46 AM   #3
tripialos
Member
 
Registered: Apr 2012
Posts: 166

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by michaelk View Post
Post the exact command the was used on the receiving machine. Also look at the command history on the receiving machine to see if any cd commands were used that might indicate the last working directory. Yes, it might be simpler to repeat the copy and make sure cd to the desired directory before initiating the receive command.
server sending (listening)
Code:
tar -cf - /folder1/ | pv -s `du -sb /folder1/|awk '{print $1}'`| pigz | nc -l 4444
Server receiving (connecting)
Code:
 nc 192.168.1.100 4444 | pigz -d | tar xf - -C /
 
Old 03-19-2015, 09:00 AM   #4
michaelk
Moderator
 
Registered: Aug 2002
Posts: 15,738

Rep: Reputation: 1753Reputation: 1753Reputation: 1753Reputation: 1753Reputation: 1753Reputation: 1753Reputation: 1753Reputation: 1753Reputation: 1753Reputation: 1753Reputation: 1753
Quote:
tar xf - -C /
Looks like the file was extracted to the /(root) directory
 
Old 03-19-2015, 09:22 AM   #5
tripialos
Member
 
Registered: Apr 2012
Posts: 166

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by michaelk View Post
Looks like the file was extracted to the /(root) directory

I know but weird thing is that its not there...and i am sure it was copied because the file was large and the df command showed reduced size...

Last edited by tripialos; 03-19-2015 at 09:23 AM.
 
Old 03-19-2015, 10:08 AM   #6
tripialos
Member
 
Registered: Apr 2012
Posts: 166

Original Poster
Rep: Reputation: Disabled
OK i found it!

I started again the copy using the same commands and the i run

lsof|grep -w tar

it turned out that the files were copied on the /root/ folder....which is weird
 
Old 03-19-2015, 10:22 AM   #7
michaelk
Moderator
 
Registered: Aug 2002
Posts: 15,738

Rep: Reputation: 1753Reputation: 1753Reputation: 1753Reputation: 1753Reputation: 1753Reputation: 1753Reputation: 1753Reputation: 1753Reputation: 1753Reputation: 1753Reputation: 1753
So there was a /folder1 created?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Cronjob to check if file contents are missing and to remove and re-copy if missing. Spuddy Linux - General 5 03-19-2014 10:20 AM
If (match) between 2 columns do nothing, else copy missing value conejo_perez16 Linux - Newbie 2 01-27-2014 02:57 PM
[SOLVED] Rsync / netcat fails to copy directories with :2f jfeyen Linux - Server 4 10-24-2013 12:25 AM
Can't get netcat port scan to output to a file jase4867 Linux - Newbie 6 07-09-2012 11:31 PM
LXer: Copy hard disk or partition image to another system using a network and netcat LXer Syndicated Linux News 0 08-12-2007 03:11 PM


All times are GMT -5. The time now is 11:59 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration