Networking Forums

Networking Forums > Computer Networking > Linux Networking > tar backup help

Reply
Thread Tools Display Modes

tar backup help

 
 
Noah Roberts
Guest
Posts: n/a

 
      02-16-2005, 08:36 PM
When running a command like this:

tar zvcf `date +%G%m%d`-testinc.tar.gz --newer-mtime=datestampfile .

It includes a bunch of empty directories in the archive. I can't find
a switch to tell it to not include directories it won't be putting
anything into. Is there such a thing or do I need to live with this or
use find?

Thanks.

 
Reply With Quote
 
 
 
 
Fao, Sean
Guest
Posts: n/a

 
      02-17-2005, 01:26 PM
Noah Roberts wrote:
> When running a command like this:
>
> tar zvcf `date +%G%m%d`-testinc.tar.gz --newer-mtime=datestampfile .
>
> It includes a bunch of empty directories in the archive. I can't find
> a switch to tell it to not include directories it won't be putting
> anything into. Is there such a thing or do I need to live with this or
> use find?


I find cpio to be better for this. Try something like:

find / -print | cpio -o | bzip2 --best > /tmp/$HOSTNAME-`date
+%m-%d-%y`.cpio.bz2

If you really want the best compression, you should first create the
archive, then compress it with bzip2 --best.

Hope that helps,

--
Sean
 
Reply With Quote
 
Noah Roberts
Guest
Posts: n/a

 
      02-17-2005, 04:10 PM

Fao, Sean wrote:
> Noah Roberts wrote:
> > When running a command like this:
> >
> > tar zvcf `date +%G%m%d`-testinc.tar.gz --newer-mtime=datestampfile

..
> >
> > It includes a bunch of empty directories in the archive. I can't

find
> > a switch to tell it to not include directories it won't be putting
> > anything into. Is there such a thing or do I need to live with

this or
> > use find?

>
> I find cpio to be better for this. Try something like:
>
> find / -print


Ok, is there such a thing as an extended version of find that will
accept something like -mnewer=DATE instead of -mnewer=n? I'm thinking
that is a better approach for me rather than datestampfile.

 
Reply With Quote
 
Noah Roberts
Guest
Posts: n/a

 
      02-17-2005, 04:16 PM

Noah Roberts wrote:

> Ok, is there such a thing as an extended version of find that will
> accept something like -mnewer=DATE instead of -mnewer=n? I'm

thinking
> that is a better approach for me rather than datestampfile.


Nevermind. If I use the -daystart switch I can do what I was after.

 
Reply With Quote
 
Noah Roberts
Guest
Posts: n/a

 
      02-17-2005, 05:20 PM

Fao, Sean wrote:

> I find cpio to be better for this. Try something like:
>
> find / -print | cpio -o | bzip2 --best > /tmp/$HOSTNAME-`date
> +%m-%d-%y`.cpio.bz2


I get a lot of things like this printed on stderr when I do that:

cpio: usr/share/man/man8/update-pciids.8.gz: truncating inode number
cpio: usr/share/man/man8/pcimodules.8.gz: truncating inode number
cpio: usr/share/misc/pci.ids: truncating inode number

Is that a problem?

 
Reply With Quote
 
Allen McIntosh
Guest
Posts: n/a

 
      02-17-2005, 09:36 PM

> I get a lot of things like this printed on stderr when I do that:
>
> cpio: usr/share/man/man8/update-pciids.8.gz: truncating inode number
> cpio: usr/share/man/man8/pcimodules.8.gz: truncating inode number
> cpio: usr/share/misc/pci.ids: truncating inode number
>
> Is that a problem?


Likely the default is to use an old format that believes inode numbers
are 16 bits or something. Use --format (e.g. --format=newc) to make the
problem go away.
 
Reply With Quote
 
Noah Roberts
Guest
Posts: n/a

 
      02-17-2005, 09:51 PM

Allen McIntosh wrote:
> > I get a lot of things like this printed on stderr when I do that:
> >
> > cpio: usr/share/man/man8/update-pciids.8.gz: truncating inode

number
> > cpio: usr/share/man/man8/pcimodules.8.gz: truncating inode number
> > cpio: usr/share/misc/pci.ids: truncating inode number
> >
> > Is that a problem?

>
> Likely the default is to use an old format that believes inode

numbers
> are 16 bits or something. Use --format (e.g. --format=newc) to make

the
> problem go away.


Sure enough. -o means copy out and default format for copy out is
'bin' the "obsolete binary format".

Tried and true.

Thanks.

 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

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
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Backup Paul Smith Windows Networking 0 10-22-2008 02:02 PM
backup Chris Davies Linux Networking 3 07-05-2006 11:46 AM
backup SP Windows Networking 5 05-31-2005 02:24 PM
Full daily backup with MS backup on W2k3 Herm Windows Networking 4 12-21-2004 01:45 PM
Backup NIC Andrew Bonney \(abweb\) Windows Networking 2 12-13-2004 08:59 PM



1 2 3 4 5 6 7 8 9 10 11