LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 05-03-2019, 11:10 AM   #1
Latitude
Member
 
Registered: Mar 2009
Posts: 65

Rep: Reputation: 16
tar backup.tar -N... why is -N useful?


Hey guys. recently came across a script used to backup directories and saw the argument -N used:

tar -cvpf $TARDIR/foo/bar_diffbackup.$TODAY.tar -N "$LASTFRI" $SOURCEDIR/project

The tar man page describes the use of -N Use only the numeric UID and GID values when creating or extracting an archive. What is an example or two of why this is useful to use numeric UID and GID values only when creating/extracting a tar?

Last edited by Latitude; 05-03-2019 at 12:07 PM.
 
Old 05-03-2019, 01:01 PM   #2
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
It appears you misread something.

The tar man page says in part:
Quote:
-N, --after-date DATE, --newer DATE
only store files newer than DATE
The usage you posted suggests it is saying don't store any files older than last Friday's date:
Code:
-N "$LASTFRI"
What line in your code is setting the LASTFRI variable? (e.g. LASTFRI=...)

Last edited by MensaWater; 05-03-2019 at 01:03 PM.
 
1 members found this post helpful.
Old 05-20-2019, 09:06 AM   #3
Latitude
Member
 
Registered: Mar 2009
Posts: 65

Original Poster
Rep: Reputation: 16
Thanks MensaWater, that it explains it. As you pointed out I must have misread the man page somehow. By the way since you asked, the LASTFRI variable is set by the assignment below in the top of the script:

LASTFRI=$(date --date='last Fri' +%Y-%m-%d)" 21:00:00"
 
1 members found this post helpful.
  


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
how can i decompress this tar.tar file? hmmm sounds new.. tar.tar.. help ;) kublador Linux - Software 14 10-25-2016 02:48 AM
What happens with backup-manager.org (very useful backup script)? Murz Linux - Software 3 07-27-2010 06:46 AM
BackUp & Restore with TAR (.tar / .tar.gz / .tar.bz2 / tar.Z) asgarcymed Linux - General 5 12-31-2006 02:53 AM
How do I un tar a .tar, .tar.z, .tar.gz file vofkid Linux - Newbie 4 03-15-2002 02:54 PM

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

All times are GMT -5. The time now is 10:10 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
Open Source Consulting | Domain Registration