Search Members Help

» Welcome Guest
[ Log In :: Register ]

Mini-ITX Boards Sale, Fanless BareBones Mini-ITX, Bootable 1G DSL USBs, 533MHz Fanless PC <-- SALE $200 each!
Get The Official Damn Small Linux Book. DSL Market , Great VPS hosting provided by Tektonic
 

[ Track this topic :: Email this topic :: Print this topic ]

reply to topic new topic new poll
Topic: question about tar command, what works for scheduled backups< Next Oldest | Next Newest >
dtf Offline





Group: Members
Posts: 196
Joined: Nov. 2005
Posted: May 04 2006,20:29 QUOTE

I have this little program that wakes up at 2 AM and executes a script to backup one of my drives.  The script contains simple tar commands like

tar uf /<backup dircertory>/<backup file>   <directory to be backup>

Even when I have an existing backup tar file and no new files to add to the existing tar file it can take a while to run if the tar file is large.  This surprises me because I thought that all it would need to do would be to add any file with a newer time stamp than the tar file.  It seems it must be doing more than that.  Does any one have an idea?  Is there an alternative, say with the -N option and what is the DATE format for the -N option if that is a valid alternative?
Back to top
Profile PM 
NotTheMama Offline





Group: Members
Posts: 42
Joined: April 2005
Posted: May 05 2006,13:57 QUOTE

I think the problem lies in the fact a tar file is an "Tape archive" file. As far as I know a tar file doesn't have its "meta data" at the beginning of the tar file, but at the beginning of every file in the tar file.
To list the content of a tar file requires, reading the whole file.
This is probably also needed for the "u" argument.

I do not know exactly what tar does, but I would expect something like:
has a file changed -> Yes -> append the new version, but do not delete the old.

The old version is still in the tarfile, but when extracting it will automatically be overwritten by the new version at the end of the tar file.

Try "tar tvf /<pathto>/<tarfile>" to view the contents of the file.
Look for the entries, which are the same.

If I'm correct, this process can take long because the whole file is read.
Back to top
Profile PM 
1 replies since May 04 2006,20:29 < Next Oldest | Next Newest >

[ Track this topic :: Email this topic :: Print this topic ]

 
reply to topic new topic new poll
Quick Reply: question about tar command

Do you wish to enable your signature for this post?
Do you wish to enable emoticons for this post?
Track this topic
View All Emoticons
View iB Code