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 either by fixed by running a fsck on the disk, but if that does not resolve the issue when 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 able to be is Jan 1, 1970. If anything is found older than that, it needs to be fixed. You can run the touch command on them to change the latest access/modify dates. There are two ways that you can 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 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 too far in the future - time_t value used by tar format is 32 bit and cannot encode times after 03:14:07 UTC on 19 January 2038.
The following will find and touch any files from the future:
find / -newermt "1 day" -exec touch {} +
Comments
0 comments
Please sign in to leave a comment.