[Box Backup-commit] COMMIT r1222 - box/chris/merge/bin/bbackupd
boxbackup-dev@fluffy.co.uk
boxbackup-dev@fluffy.co.uk
Sat, 16 Dec 2006 16:12:35 +0000
Author: chris
Date: 2006-12-16 16:12:35 +0000 (Sat, 16 Dec 2006)
New Revision: 1222
Modified:
box/chris/merge/bin/bbackupd/BackupDaemon.cpp
Log:
Improved debugging when a path to a location doesn't exist or can't be
opened. (refs #3)
Modified: box/chris/merge/bin/bbackupd/BackupDaemon.cpp
===================================================================
--- box/chris/merge/bin/bbackupd/BackupDaemon.cpp 2006-12-15 09:19:27 UTC (rev 1221)
+++ box/chris/merge/bin/bbackupd/BackupDaemon.cpp 2006-12-16 16:12:35 UTC (rev 1222)
@@ -1562,8 +1562,19 @@
// First, get the directory's attributes and modification time
box_time_t attrModTime = 0;
BackupClientFileAttributes attr;
- attr.ReadAttributes(ploc->mPath.c_str(), true /* directories have zero mod times */,
- 0 /* not interested in mod time */, &attrModTime /* get the attribute modification time */);
+ try
+ {
+ attr.ReadAttributes(ploc->mPath.c_str(),
+ true /* directories have zero mod times */,
+ 0 /* not interested in mod time */,
+ &attrModTime /* get the attribute modification time */);
+ }
+ catch (BoxException &e)
+ {
+ ::syslog(LOG_ERR, "Failed to get attributes for path "
+ "'%s', skipping.", ploc->mPath.c_str());
+ continue;
+ }
// Execute create directory command
MemBlockStream attrStream(attr);
@@ -1587,6 +1598,8 @@
{
delete ploc;
ploc = 0;
+ ::syslog(LOG_ERR, "Failed to setup location '%s' path '%s'",
+ ploc->mName.c_str(), ploc->mPath.c_str());
throw;
}
}