LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
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 08-10-2016, 01:12 PM   #1
anon091
Senior Member
 
Registered: Jun 2009
Posts: 1,795

Rep: Reputation: 49
Best way to zip a large directory in the background with logging to know it completed successfully


I have a half TB directory that I want to tgz. What's the best command to tgz in in the background with logging I can tail or check in the end somehow to know it completed successfully? I can't leave my ssh session open for the days this will probably take to complete, but want to make sure it actually completes successfully tgz'ing all the files.
 
Old 08-10-2016, 01:46 PM   #2
Beads
Member
 
Registered: Nov 2004
Location: Washington
Distribution: Mint
Posts: 104

Rep: Reputation: 17
I have not compressed that much data yet; but open a terminal and type "man zip". There are a lot of information in that manual; and in verbose mode, it will log in that terminal a blow by blow status of each file compressed. It also recognizes most of the zipped file types. It also has a verification mode.

Just might work for what you desire.
 
Old 08-10-2016, 01:49 PM   #3
Sefyir
Member
 
Registered: Mar 2015
Distribution: Linux Mint
Posts: 634

Rep: Reputation: 316Reputation: 316Reputation: 316Reputation: 316
Use screen or tmux.
For screen

Code:
screen -S zipping_thing
program files_to_compress
Then Ctrl-a, Ctrl-d to leave
When you want to return to it,
Code:
screen -r zipping_thing
 
2 members found this post helpful.
Old 08-10-2016, 02:24 PM   #4
24x7servermanagement
Member
 
Registered: Jul 2016
Location: India
Distribution: CentOS, Redhat, Ubuntu and Debian
Posts: 57

Rep: Reputation: Disabled
You can use jobs command as well. Refer : jobs command example
 
Old 08-10-2016, 07:57 PM   #5
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,359

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
For tgz, something like
Code:
nohup tar zcvf /path/to/target.tgz <dirs to tar/compress> >/path/to/target.log 2>&1 &
nohup = keep running even after I logout
2 >&1 = send o/p msgs and err msgs to same log
final '&' = run it in background ie give me term prompt back immediately

HTH
 
3 members found this post helpful.
Old 08-10-2016, 08:05 PM   #6
anon091
Senior Member
 
Registered: Jun 2009
Posts: 1,795

Original Poster
Rep: Reputation: 49
Thanks everyone!
 
  


Reply



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
City of Munich: "Migration to sustainable desktop completed successfully" jeremy Linux - News 1 05-30-2013 02:53 PM
LXer: City of Munich: "Migration to sustainable desktop completed successfully" LXer Syndicated Linux News 0 05-30-2013 12:30 PM
Command not completed successfully?? anishkumarv Linux - Newbie 2 07-29-2011 04:05 AM
printing my own message as each command in a bash script has completed successfully CoffeeKing!!! Linux - Newbie 9 01-26-2009 11:02 AM
trouble with background process and logging out successfully isaia Linux - Newbie 3 04-05-2004 12:03 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:17 AM.

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
Open Source Consulting | Domain Registration