We moved this page to our Documentation Portal. You can find the latest updates here. |
Issue
A backup is failing, because the tar function is giving an error:
Running: tar -C /mnt/onapp-backup-t54asdf345 --one-file-system -zcp -f /onapp/backups/t/b/t54asdf345 --numeric-owner --xattrs .
tar: value -9999 out of time_t range 0..8589934591
Environment
OnApp
Normal Backups
Resolution
We will need to change the latest modified date on the file to be within a legitimate range for tar to work properly. This can be fixed by running a fsck on the disk, but if that does not resolve the issue, then we can find the problem files this way:
The find command will be used to search for files with specific modified dates. If we wanted to find one that was modified over 15000 days ago, we could use:
find / -mtime +15000
The oldest a file should be is Jan 1, 1970. If anything older than that is found, it needs to be fixed. You can run the touch command on them to change the latest access/modify dates. There are two ways to do this.
You can either find the files yourself and run touch on them manually. e.g.
touch /etc/fstab
Or, we can combine the two commands and use the find command's exec flag:
find / -mtime +$(( `date -u +%s` / 86400 - 1 )) -exec touch {} +
This will find all the files older than Linux Epoch Time, and then run touch on them. Find replaces {} with the files it's finding, and the + denotes the end of the exec command.
It is also possible, but rare, that some files have timestamp set too far in the future. The format of the time_t value used by tar is 32 bit, and it cannot encode the time after 03:14:07 UTC on 19 January 2038.
The following command will find and touch any files from the future:
find / -newermt "1 day" -exec touch {} +