timegaps icon indicating copy to clipboard operation
timegaps copied to clipboard

FeatureRequest: Parameter --ignore-invalid-items or --time-from-string-regex

Open OE2WNL opened this issue 6 years ago • 0 comments

When using the --time-from-string parameter and not all input lines are in the expected match format timegaps exits with error

ERROR: Error while parsing time from item string. Error: time data u'pool/test@2018-03-29__14-11-35' does not match format 'storagepool/test@backup_%Y-%m-%d__%H-%M-%S'

As it happens that I have regular zfs snapshots with name 2018-03-29__14-30-00 but also other named snapshots when offsite-backup-script transferes snapshots to another system and creates a snapshot before transfering with name backup_2018-03-29__18-00-00

For this cases it would probably be usefull to have a --ignore-invalid-items parameter where the backup_... snapshots would be simply keept/accepted.

My command is as follows: sudo zfs list -r -H -t snapshot -o name pool/test | timegaps --stdin --time-from-string "pool/test@%Y-%m-%d__%H-%M-%S" recent2,hours10,days30,weeks12,months14,years3

Probably also a --time-from-string-regex would be a solution - so User can use wildcards + date patterns for item selection.

Interested in what you think about my usecase. Greetings Wolfgang

OE2WNL avatar Mar 31 '18 23:03 OE2WNL