Operating System - HP-UX
1823472 Members
2357 Online
109660 Solutions
New Discussion юеВ

tar error - file changed size

 
SOLVED
Go to solution
Ian Lochray
Respected Contributor

tar error - file changed size

I have a backup script which uses tar to back up files. I cannot use fbackup as the script has to work on multiple platforms. Occasionally, I get an error from tar saying that a file has changed size. I have seen references to this error in previous postings and some of the replies state that the error (and other errors that give a return code of 5) is non-fatal.
Does "non-fatal" mean that the file is correctly backed up or just that the error is not serious enough to stop tar in its tracks?
4 REPLIES 4
John Bolene
Honored Contributor

Re: tar error - file changed size

You have tarred to a file in the same directory such as

tar -cf stuff *

this will also try to tar the stuff file into itself, bad thing to do
cd /tmp
tar -cf stuff /other-dir
will create the stuff file in /tmp
It is always a good day when you are launching rockets! http://tripolioklahoma.org, Mostly Missiles http://mostlymissiles.com
A. Clay Stephenson
Acclaimed Contributor
Solution

Re: tar error - file changed size

Hi:

It means that while being backed up a file was modified (typically appended) by another process. Whether this is bad or not depends on the application. If it is a database it is almost certainly very bad. One way to avoid these kinds of errors is to do an OnlineJFS snapshot mount and backup the snapshot. The snapshot takes only a few seconds and then all the snapshot files are certain to remain constant while the 'real' files can remain in use.

Clay

If it ain't broke, I can fix that.
Ian Lochray
Respected Contributor

Re: tar error - file changed size

John,
the tar is to a tape, not to a file.
Clay,
unfortunately, many of our customers do not have online JFS. The file is not a database file. As you suggest, it is appended to periodically. It appears that the backup is coinciding with one of these periods.
Sanjay_6
Honored Contributor

Re: tar error - file changed size

Hi,

As clay told you, the file got modified (appended or reduced) during the backup. does not look that serious to me, until the file is very important. There is no choice over this other than online JFs where you can create a snapshot and back that up. That is the only way you can be certain that you have a backup whcih matches the state of you file when the snapshot was taken. Otherwise learn to live with the error message you are getting. No harm in that.

Thanks