Extracting .Tar File in Background (server) particular directory

tgo316

Verified User
Joined
May 4, 2005
Messages
61
Hello
I have a file backup.tar which I wish to extract in the background on the server.
I know tar xf backup.tar -C /home/extracted will extract it, but since my connection is too slow and breaks all the time, and the file is around 260 gigs, it has failed to go through on 5 occassions.

So can I extract this on the background itself? using the server's resources? something where my internet connection won't matter.
Also, If I could extract particular directories like say for example etc then that would be great. As it will save me time and I can only extract what hasn't already been extracted.

Best Regards
Amit
 
Hi tgo316,
In Unix it is easy to run tasks in the background, simply add an asterisk (&) at the end of the command. If the background task is still outputting messages to the terminal you can stop it by killing the process and suffixing your original command with the following
Code:
> /dev/null &
So to apply this logic to your case..
Code:
change 
# tar xf backup.tar -C /home/extracted
to
# tar xf backup.tar -C /home/extracted &

To view all of your background processes type
# jobs
This way, even if your SSH session times out your background processes will continue to run.

More info here;
http://www.bsdguides.org/guides/freebsd/beginners/job_control
 
hello,
i have currently used an option called screen.
it's doing good so far. So am hoping it stays so.

thanks richboy, i'll keep this in mind as well.

Any idea if i can extract particular folders from a .tar file?

Best Regards
Amit
 
Screen is much better then just forking in the background.
 
yes, the tar file that am trying to go for is a huge 264 gb file, and so far i've extracted around 40% of the file without problems.
 
Back
Top