question about tar -N
I'm puzzled by how tar -N option works.
I tried many date formats and eventually found one that tar seemed happy with, yet it didn't just archive the files that were newer than the given date but also included some older files. I've tried -N, --newer, and --after-date. The man page says that you can use a date or a filename, and I have tried both. I'm trying to set up a system for archiving *.flac and other music files. When I run tar with a date option or a filename it seems to ignore *.jpg and *.pdf files that are older than the given date (as expected) but it includes some flac files in the tarball even though they are older than the date. Is there another version of tar, other than that included with Ubuntu, that does work, or am I trying to use it incorrectly? I just want a tarball of files (flac, mp3, jpg, pdf, ...whatever) that are newer than a particular file (a pretty basic requirement). I know that --newer works with find, but if there's a working tar option I'd rather just use that. One command I tried was:- tar --newer=./newones.txt --exclude-from="exclude.tar" -vcf test.tar /media/audio/* This dumped 2011-02-06 12:47 /media/audio/16bit/beethoven/diabelli/331369-66763-01-20.flac but not 2011-08-10 12:37 /media/audio/16bit/saint_saens/saint_saens.flac which it reported as unchanged. Surely they should both have been reported as unchanged? newones.txt is dated 2011-08-18 00:00 Any help would be appreciated. - Richard -- Richard Kimber Political Science Resources http://www.PoliticsResources.net/ -- ubuntu-users mailing list ubuntu-users@lists.ubuntu.com Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users |
question about tar -N
On Sat, 2011-08-20 at 17:42 +0100, R Kimber wrote:
> I'm puzzled by how tar -N option works. > > I tried many date formats and eventually found one that tar seemed happy > with, yet it didn't just archive the files that were newer than the > given date but also included some older files. I've tried -N, --newer, and > --after-date. The man page says that you can use a date or a > filename, and I have tried both. > > I'm trying to set up a system for archiving *.flac and other music files. > When I run tar with a date option or a filename it seems to ignore *.jpg and > *.pdf files that are older than the given date (as expected) but it > includes some flac files in the tarball even though they are older than the > date. > > Is there another version of tar, other than that included with Ubuntu, that > does work, or am I trying to use it incorrectly? Someone else may be able to help you with the -N switch, but as to are there other options, I started at some point using bsdtar in place of tar as it automatically recognized the compression format used when extracting. That was useful for me at the time. TAR may do that as well nowadays. But I suggest you give bsdtar a go. The --newer and --newer-mtime (and --newer-than file and --newer-mtime-than file) switches should work as advertised based on my experience. Tero -- ubuntu-users mailing list ubuntu-users@lists.ubuntu.com Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users |
question about tar -N
On 08/20/2011 09:42 AM, R Kimber wrote:
> I'm puzzled by how tar -N option works. > > I tried many date formats and eventually found one that tar seemed happy > with, yet it didn't just archive the files that were newer than the > given date but also included some older files. I've tried -N, --newer, and > --after-date. The man page says that you can use a date or a > filename, and I have tried both. > > I'm trying to set up a system for archiving *.flac and other music files. > When I run tar with a date option or a filename it seems to ignore *.jpg and > *.pdf files that are older than the given date (as expected) but it > includes some flac files in the tarball even though they are older than the > date. ... I'm not familiar with 'tar -N' either. But what I gather is that 'tar -N' associated with the file modification date. Could this be what you are running into? Otherwise look at: https://bugs.launchpad.net/ubuntu/+source/tar and try asking on: https://answers.launchpad.net/ubuntu/+source/tar -- ubuntu-users mailing list ubuntu-users@lists.ubuntu.com Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users |
question about tar -N
On Sat, 20 Aug 2011 20:14:40 +0300
Tero Pesonen wrote: > Someone else may be able to help you with the -N switch, but as to are > there other options, I started at some point using bsdtar in place of > tar as it automatically recognized the compression format used when > extracting. That was useful for me at the time. TAR may do that as well > nowadays. But I suggest you give bsdtar a go. The --newer and > --newer-mtime (and --newer-than file and --newer-mtime-than file) > switches should work as advertised based on my experience. Thanks. I've looked at that but it doesn't seem to have a 'read exclusions from an external file' option, which I'd also like. - Richard -- Richard Kimber Political Science Resources http://www.PoliticsResources.net/ -- ubuntu-users mailing list ubuntu-users@lists.ubuntu.com Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users |
question about tar -N
On Sat, 20 Aug 2011 21:11:37 -0700
NoOp wrote: > I'm not familiar with 'tar -N' either. But what I gather is that 'tar > -N' associated with the file modification date. Could this be what you > are running into? > > Otherwise look at: > https://bugs.launchpad.net/ubuntu/+source/tar > and try asking on: > https://answers.launchpad.net/ubuntu/+source/tar Thanks. In the interest of getting the script working quickly I think I'd better go with a less elegant solution and use 'find' to create a list of new files and then use tar. - Richard. -- Richard Kimber Political Science Resources http://www.PoliticsResources.net/ -- ubuntu-users mailing list ubuntu-users@lists.ubuntu.com Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users |
question about tar -N
On 08/20/2011 11:42 AM, R Kimber wrote:
[snip] One command I tried was:- tar --newer=./newones.txt --exclude-from="exclude.tar" -vcf test.tar /media/audio/* This dumped 2011-02-06 12:47 /media/audio/16bit/beethoven/diabelli/331369-66763-01-20.flac but not 2011-08-10 12:37 /media/audio/16bit/saint_saens/saint_saens.flac which it reported as unchanged. Surely they should both have been reported as unchanged? newones.txt is dated 2011-08-18 00:00 Any help would be appreciated. - Richard What are the ctimes for those files? Use "stat" or "ls -l --time=status" I think that tar compares ctime rather than mtime here. -- sktsee -- ubuntu-users mailing list ubuntu-users@lists.ubuntu.com Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users |
| All times are GMT. The time now is 07:02 AM. |
VBulletin, Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.