Issue


Backup fails, because of the tar function with the following message:

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
CODE


Environment


OnApp

Normal backups


Resolution


To resolve the issue, change the latest modified date in the file to be within a legitimate range for tar to work properly. This can be fixed by running fsck on the disk.

If it does not resolve the issue, find the problem files in the following way:

  1. The find command is used to search for files with specific modified dates. To find the one that was modified over 15,000 days ago, use:

    find / -mtime +15000
    CODE

    The oldest file should be as of Jan 1, 1970. If anything older than that is found, it should be fixed. You can run the touch command on them to change the latest access/modify dates. There are two ways to do it:
     Find the files on your own and run touch on them manually:

    touch /etc/fstab
    CODE

    OR
     Combine the two commands and use the find command's exec flag:

    find / -mtime +$(( `date -u +%s` / 86400 - 1 )) -exec touch {} +
    CODE

    It will find all the files older than the Linux Epoch time, and then run touch on them.  The find command replaces {} with the files it finds, and the + denotes the end of the exec command.

    Additionally, some files may have a timestamp set too far in the future. The format of the time_t value used by tar is 32 bits, and it cannot encode the time after 03:14:07 UTC on January 19, 2038. 

    The following command will find and touch any files from the future:

    find / -newermt "1 day" -exec touch {} +
    CODE