statd['volume'] = self.vol_no
# backup file
- tarobj.add(path, arcname = statd['path'], recursive=False)
+
+ try: # backup file
+ tarobj.add(path, arcname = statd['path'], recursive=False)
+ except FileNotFoundError as exn:
+ # file vanished since the call to access(3) above
+ self.logger.warning ("object [%s] no longer available in "
+ "file system (error: %s); skipping"
+ % (path, str (exn)))
+ continue # prevent indexing
# retrieve file offset
statd['offset'] = tarobj.get_last_member_offset()
self.logger.debug("[STORE] %s" % dpath['path'])
- # backup file
- tarobj.add(dpath['path'], arcname=stat['path'], recursive=False)
+ try: # backup file
+ tarobj.add(dpath['path'], arcname=stat['path'], recursive=False)
+ # retrieve file offset
+ stat['offset'] = tarobj.get_last_member_offset()
+ except FileNotFoundError as exn:
+ # file vanished since the call to access(3) above
+ self.logger.warning ("object [%s] no longer available in "
+ "file system (error: %s); skipping"
+ % (dpath ["path"], str (exn)))
+ stat = None # prevent indexing
- # retrieve file offset
- stat['offset'] = tarobj.get_last_member_offset()
elif action == 'delete':
path = self.unprefixed(ipath['path'])
stat = {