LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   tar -N (newer that Date) problem (https://www.linuxquestions.org/questions/linux-general-1/tar-n-newer-that-date-problem-401995/)

johnny_cashier 01-11-2006 07:25 AM

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

pixellany 01-11-2006 07:58 AM

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>

johnny_cashier 01-11-2006 08:08 AM

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


All times are GMT -5. The time now is 09:22 PM.