Forum archive
Problem with TKLBAM backup (+simulation)
Hello,
I setup the TKLBAM but I'm getting an error. Everytime the missing file is different and most of the time related to WP Total Cache files.
Why is this?
Traceback (most recent call last):
File "/usr/bin/tklbam-backup", line 510, in <module>
main()
File "/usr/bin/tklbam-backup", line 443, in main
opt_resume, True, dump_path if dump_path else "/")
File "/usr/lib/tklbam/backup.py", line 237, in __init__
self._create_extras(extras_paths, profile_paths, backup_conf)
File "/usr/lib/tklbam/backup.py", line 175, in _create_extras
conf.overrides.fs)
File "/usr/lib/tklbam/backup.py", line 111, in _write_whatchanged
changes = whatchanged(dirindex, paths)
File "/usr/lib/tklbam/changes.py", line 265, in whatchanged
changes += [ Change.Overwrite(path) for path in new + edited ]
File "/usr/lib/tklbam/changes.py", line 92, in __init__
self.uid = self.stat.st_uid
File "/usr/lib/tklbam/changes.py", line 67, in stat
self._stat = os.lstat(self.path)
OSError: [Errno 2] No such file or directory: '/var/www/--------/wp-content/cache/page_enhanced/----/----/_index_ssl.html_old'
Firstly, I hope you don't mind but I reformatted your post and added a couple of tags that I thought might be useful... I also removed part of the TKLBAM output to make the stacktrace stand out a little more. FWIW, if you're unsure on what/how much to post of an error message, you are better off posting more rather than less; so you did the right thing, I just wanted to clarify the important part in this instance (the stacktrace itself).
Essentially, it appears what is happening is that there is a race condition when TKLBAM is trying to create a backup. The first thing it does is scans for files to backup, then it backs them up. But in your case, at least one of the files that it's trying to backup does not exist when it tries to back it up...
However, seeing as it appears to be a cache file in this instance (and judging from your earlier comment, is always) then that's easily fixed. Besides, you probably don't want cached files included in your backup anyway, as they're just going to be wasted space. By the time you come to restore, they'll almost certainly be stale anyway...
So the easiest (and best) way to work around that issue would be to exclude the cache location from being part of the backup. TBH, I'm not 100% sure whether you are best off excluding the complete '/var/www/--------/wp-content/cache' directory, or whether you shoudl try to drill down a bit more to exclude specific sub-directories. I suggest that you do some testing, but of backups and restores (perhaps even to a separate VM to ensure that not only is it ok to exclude those dirs, but also that it all works as expected in general).
To add an exclusion, add the full path to the directory (or file) as a separate line in the /etc/tklbam/overrides file. E.g. If you wished to exclude /var/www/wordpress/cache:
I hope that helps. Please post back and let us know how you go! :)