LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 01-11-2006, 08:25 AM   #1
johnny_cashier
LQ Newbie
 
Registered: Jan 2006
Posts: 2

Rep: Reputation: 0
tar -N (newer that Date) problem


Hi there
Im having a problem using the tar -N switch (newer that DATE)
I want to only add files that were created after a certain to the tar file

This is the listing of the directory i want to back up

drwxr-xr-x 2 root root 4096 Jan 11 12:55 .
drwxr-xr-x 4 cormac.cassidy cormac.cassidy 4096 Jan 11 12:54 ..
-rw-r--r-- 1 root root 0 Jan 9 10:43 four
-rw-r--r-- 1 root root 0 Jan 8 00:00 one
-rw-r--r-- 1 root root 41 Jan 9 15:19 putontape
-rw-r--r-- 1 root root 0 Jan 9 10:43 three
-rw-r--r-- 1 root root 0 Jan 8 00:00 two



Now this is the command i run and the output

blah# tar Ncvf 2006-01-09 test.tar back/
tar: Treating date `2006-01-09' as 2006-01-09 00:00:00 + 0 nanoseconds
back/
back/four
back/one
back/three
back/two
back/putontape

Instead of just adding the files - four, putontape and three it adds all of the files in the directory

Any suggestions



Im running Debian by the way
 
Old 01-11-2006, 08:58 AM   #2
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
I have a hunch that it wants something like this:

tar -N <datestring> -cvf <path>

Generally, switches with arguments have the argument right after the switch.

Looking at man tar, I can't find the correct format for <datestring>
 
Old 01-11-2006, 09:08 AM   #3
johnny_cashier
LQ Newbie
 
Registered: Jan 2006
Posts: 2

Original Poster
Rep: Reputation: 0
same output

That produces the same output

The man pages dont say much about the DATE format, but its seems to be picking up the correct date
e.g.tar: Treating date `2006-01-09' as 2006-01-09 00:00:00 + 0 nanoseconds
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
tar a date range rayia Programming 3 01-03-2006 08:52 AM
Bash backup script failing using tar and --newer option saldkj Programming 3 03-12-2005 01:03 PM
Newer version of tar? imahdi Linux - Software 1 01-04-2005 09:26 PM
Tar with --newer option tarring all dirs jlangelier Linux - Newbie 0 07-09-2003 01:31 AM
tar --newer .. or --list-incremental pfunk Linux - Software 1 06-21-2002 03:57 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 07:09 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