# How to avoid bad root files while using hadd

**URL:** <https://root-forum.cern.ch/t/how-to-avoid-bad-root-files-while-using-hadd/46638>\
**Category:** Newbie\
**Created:** [September 2, 2021, 2:18pm UTC](https://root-forum.cern.ch/t/how-to-avoid-bad-root-files-while-using-hadd/46638 "2021-09-02T14:18:51Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vaibhavi\_Bhalchandra](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/vaibhavi_bhalchandra/32/27290_2.png) [@Vaibhavi\_Bhalchandra](https://root-forum.cern.ch/u/Vaibhavi_Bhalchandra)\
**Post date:** [September 2, 2021, 2:18pm UTC](https://root-forum.cern.ch/t/how-to-avoid-bad-root-files-while-using-hadd/46638/1 "2021-09-02T14:18:51Z")

</div>

Hey, could anyone let me know if there is a way to avoid bad files while using hadd function to merge several hundred root files? hadd just stops when it encounters a bad/failed job.

---

<div class="post-metadata">

**Author:** ![couet](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/couet/32/12037_2.png) [@couet](https://root-forum.cern.ch/u/couet)\
**Post date:** [September 2, 2021, 3:17pm UTC](https://root-forum.cern.ch/t/how-to-avoid-bad-root-files-while-using-hadd/46638/2 "2021-09-02T15:17:58Z")

</div>

I think the command gives the response when you do:

```auto
% hadd --help

usage: hadd [-a A] [-k K] [-T T] [-O O] [-v V] [-j J] [-dbg DBG] [-d D] [-n N] [-cachesize CACHESIZE] [-experimental-io-features EXPERIMENTAL_IO_FEATURES] [-f F] [-fk FK] [-ff FF]
            [-f0 F0] [-f6 F6]
            TARGET SOURCES

OPTIONS:
  -a Append to the output
  -k Skip corrupt or non-existent files, do not exit. <<< This option
....

```
