Fix: do not wipe archive_dir to prevent unexpected data deletion

This commit is contained in:
f3flight 2016-09-06 13:36:28 +00:00
parent 16087cfab6
commit 19e4fec8fd
3 changed files with 2 additions and 3 deletions

View File

@ -29,7 +29,7 @@ Some of the parameters available in configuration file:
* **logs_size_coefficient** a float value used to check local free space; 'logs size * coefficient' must be > free space; values lower than 0.3 are not recommended and will likely cause local disk fillup during log collection * **logs_size_coefficient** a float value used to check local free space; 'logs size * coefficient' must be > free space; values lower than 0.3 are not recommended and will likely cause local disk fillup during log collection
* **do_print_results** print outputs of commands and scripts to stdout * **do_print_results** print outputs of commands and scripts to stdout
* **clean** True/False - erase previous results in outdir and archive_dir dir, if any * **clean** True/False - erase previous results in outdir and archive_dir dir, if any
* **outdir** directory to store output data * **outdir** directory to store output data. **WARNING: this directory is WIPED by default at the beginning of data collection. Be careful with what you define here.**
* **archive_dir** directory to put resulting archives into * **archive_dir** directory to put resulting archives into
* **timeout** timeout for SSH commands and scripts in seconds * **timeout** timeout for SSH commands and scripts in seconds

View File

@ -16,7 +16,7 @@
# under the License. # under the License.
project_name = 'timmy' project_name = 'timmy'
version = '1.19.0' version = '1.19.1'
if __name__ == '__main__': if __name__ == '__main__':
import sys import sys

View File

@ -538,7 +538,6 @@ class NodeManager(object):
conf['archive_dir'] += timestamp_str conf['archive_dir'] += timestamp_str
if conf['clean']: if conf['clean']:
shutil.rmtree(conf['outdir'], ignore_errors=True) shutil.rmtree(conf['outdir'], ignore_errors=True)
shutil.rmtree(conf['archive_dir'], ignore_errors=True)
if not conf['shell_mode']: if not conf['shell_mode']:
self.rqdir = conf['rqdir'] self.rqdir = conf['rqdir']
if (not os.path.exists(self.rqdir)): if (not os.path.exists(self.rqdir)):