qm2k / bbts Goto Github PK
View Code? Open in Web Editor NEWA better timer script for BURP backup
License: GNU Affero General Public License v3.0
A better timer script for BURP backup
License: GNU Affero General Public License v3.0
(See grke/burp#564 .) Will most likely break our code, and needs supporting in any case.
(See grke/burp#563 .) It's called .created
. We'd better switch to it.
While trying to determine if previous backup was resumed BBTS reads last backup log in text mode and searches it for certain strings. Text mode read fails if file contains non-UTF-8 characters which can occur due to qm2k/burp#2.
Currently uses mixture of dicts and Conditions
member fields. Probably needs separate class.
Hello,
I'm trying to backup a new client on a brand new server (so no prior backups). I noticed burp is sending /data/burp/data/client_name/current
as current path and this file doesn't exists. In the client_name directory I only have files .command
and .created
. The file .created
contains a timestamp (2023-01-13 11:39:07 -0500
).
The script is crashing with this stack trace:
Jan 13 11:39:07 dsb5 burp[3307127]: WARNING: Traceback (most recent call last):
Jan 13 11:39:07 dsb5 burp[3307127]: WARNING: File "/usr/local/bin/timer_script.py", line 436, in <module>
Jan 13 11:39:07 dsb5 burp[3307127]: WARNING: sys.exit(main(sys.argv))
Jan 13 11:39:07 dsb5 burp[3307127]: WARNING: File "/usr/local/bin/timer_script.py", line 431, in main
Jan 13 11:39:07 dsb5 burp[3307127]: WARNING: conditions_check = check_conditions(prior_path, *argument_strings)
Jan 13 11:39:07 dsb5 burp[3307127]: WARNING: File "/usr/local/bin/timer_script.py", line 403, in check_conditions
Jan 13 11:39:07 dsb5 burp[3307127]: WARNING: prior_backup = Backup(prior_path)
Jan 13 11:39:07 dsb5 burp[3307127]: WARNING: File "/usr/local/bin/timer_script.py", line 127, in __init__
Jan 13 11:39:07 dsb5 burp[3307127]: WARNING: self.client_created = self.__get_client_created_timestamp() if self.path and self.is_new() else None
Jan 13 11:39:07 dsb5 burp[3307127]: WARNING: File "/usr/local/bin/timer_script.py", line 116, in __get_client_created_timestamp
Jan 13 11:39:07 dsb5 burp[3307127]: WARNING: return read_timestamp(filename)
Jan 13 11:39:07 dsb5 burp[3307127]: WARNING: File "/usr/local/bin/timer_script.py", line 93, in read_timestamp
Jan 13 11:39:07 dsb5 burp[3307127]: WARNING: timestamp = datetime.datetime.strptime(timestamp_string, '%Y-%m-%d %H:%M:%S')
Jan 13 11:39:07 dsb5 burp[3307127]: WARNING: File "/usr/lib/python3.10/_strptime.py", line 568, in _strptime_datetime
Jan 13 11:39:07 dsb5 burp[3307127]: WARNING: tt, fraction, gmtoff_fraction = _strptime(data_string, format)
Jan 13 11:39:07 dsb5 burp[3307127]: WARNING: File "/usr/lib/python3.10/_strptime.py", line 349, in _strptime
Jan 13 11:39:07 dsb5 burp[3307127]: WARNING: raise ValueError("time data %r does not match format %r" %
Jan 13 11:39:07 dsb5 burp[3307127]: WARNING: ValueError: time data '11:39:07 -0500' does not match format '%Y-%m-%d %H:%M:%S'
Jan 13 11:39:07 dsb5 burp[3307127]: /usr/local/bin/timer_script.py returned: 1
Running on Ubuntu 22.04, BURP 2.4.0, Python 3.10.6.
Thanks!
(See grke/burp#562 .) We'd better use this file when available instead of parsing the log.
Currently it's either something or nothing. More levels would be useful:
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.