1
0
mirror of https://github.com/kellyjonbrazil/jc.git synced 2025-07-15 01:24:29 +02:00

crontab bugfix: inserting header row was clobbering the first data row

This commit is contained in:
Kelly Brazil
2020-02-05 14:44:49 -08:00
parent 6bad164b5e
commit 9449f1f5d5
4 changed files with 9 additions and 3 deletions

View File

@ -8,6 +8,7 @@ jc changelog
- Add crontab file parser with user support
- Add __version__ variable to parser modules
- Updated history parser to output "line" as an integer
- Bugfix in crontab file parser: header insertion was clobbering first row
- Just-in-time loading of parser modules instead of loading all at start
20191217 v1.6.1

View File

@ -132,7 +132,7 @@ import jc.parsers.universal
class info():
version = '1.0'
version = '1.1'
description = 'crontab file parser'
author = 'Kelly Brazil'
author_email = 'kellyjonbrazil@gmail.com'
@ -252,7 +252,7 @@ def parse(data, raw=False, quiet=False):
'command': cmd})
# Add header row for parsing
cleandata[0] = 'minute hour day_of_month month day_of_week command'
cleandata[:0] = ['minute hour day_of_month month day_of_week command']
if len(cleandata) > 1:
cron_list = jc.parsers.universal.simple_table_parse(cleandata)

View File

@ -254,7 +254,7 @@ def parse(data, raw=False, quiet=False):
'command': cmd})
# Add header row for parsing
cleandata[0] = 'minute hour day_of_month month day_of_week user command'
cleandata[:0] = ['minute hour day_of_month month day_of_week user command']
if len(cleandata) > 1:
cron_list = jc.parsers.universal.simple_table_parse(cleandata)

View File

@ -0,0 +1,5 @@
# Run the hourly jobs
SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root
01 * * * * root run-parts /etc/cron.hourly