/
usr
/
lib
/
rads
/
venv
/
lib
/
python3.13
/
site-packages
/
/usr/lib/rads/venv/lib/python3.13/site-packages
mkdir
upload
Name
Size
Mode
Actions
arrow/
-
0755
rm
arrow-1.3.0.dist-info/
-
0755
rm
bakauth/
-
0755
rm
bakauth-1.6.3.dist-info/
-
0755
rm
boto3/
-
0755
rm
boto3-1.40.30.dist-info/
-
0755
rm
botocore/
-
0755
rm
botocore-1.40.30.dist-info/
-
0755
rm
certifi/
-
0755
rm
certifi-2025.8.3.dist-info/
-
0755
rm
charset_normalizer/
-
0755
rm
charset_normalizer-3.4.3.dist-info/
-
0755
rm
cpapis/
-
0755
rm
cpapis-1.0.dist-info/
-
0755
rm
cproc/
-
0755
rm
cproc-1.0.dist-info/
-
0755
rm
dateutil/
-
0755
rm
dateutil-stubs/
-
0755
rm
distro/
-
0755
rm
distro-1.9.0.dist-info/
-
0755
rm
dns/
-
0755
rm
dnspython-2.7.0.dist-info/
-
0755
rm
exim_analytics/
-
0755
rm
exim_analytics-0.1.7.dist-info/
-
0755
rm
idna/
-
0755
rm
idna-3.10.dist-info/
-
0755
rm
iniconfig/
-
0755
rm
iniconfig-2.1.0.dist-info/
-
0755
rm
jmespath/
-
0755
rm
jmespath-1.0.1.dist-info/
-
0755
rm
netaddr/
-
0755
rm
netaddr-1.3.0.dist-info/
-
0755
rm
netifaces-0.11.0.dist-info/
-
0755
rm
packaging/
-
0755
rm
packaging-25.0.dist-info/
-
0755
rm
pip/
-
0755
rm
pip-26.2.1.dist-info/
-
0755
rm
pluggy/
-
0755
rm
pluggy-1.6.0.dist-info/
-
0755
rm
pp_api/
-
0755
rm
pp_api-1.3.1.dist-info/
-
0755
rm
prettytable/
-
0755
rm
prettytable-3.16.0.dist-info/
-
0755
rm
psutil/
-
0755
rm
psutil-7.0.0.dist-info/
-
0755
rm
pygments/
-
0755
rm
pygments-2.19.2.dist-info/
-
0755
rm
pymysql/
-
0755
rm
pymysql-1.1.2.dist-info/
-
0755
rm
pytest/
-
0755
rm
pytest-8.4.2.dist-info/
-
0755
rm
python_crontab-2.7.1.dist-info/
-
0755
rm
python_dateutil-2.9.0.post0.dist-info/
-
0755
rm
PyYAML-6.0.2.dist-info/
-
0755
rm
rads/
-
0755
rm
rads-4.3.2.dist-info/
-
0755
rm
requests/
-
0755
rm
requests-2.32.5.dist-info/
-
0755
rm
restic/
-
0755
rm
restic-1.4.1.dist-info/
-
0755
rm
s3transfer/
-
0755
rm
s3transfer-0.14.0.dist-info/
-
0755
rm
six-1.17.0.dist-info/
-
0755
rm
tabulate/
-
0755
rm
tabulate-0.9.0.dist-info/
-
0755
rm
types_python_dateutil-2.9.0.20250822.dist-info/
-
0755
rm
urllib3/
-
0755
rm
urllib3-2.5.0.dist-info/
-
0755
rm
wcwidth/
-
0755
rm
wcwidth-0.2.13.dist-info/
-
0755
rm
wheel/
-
0755
rm
wheel-0.48.0.dist-info/
-
0755
rm
yaml/
-
0755
rm
_pytest/
-
0755
rm
_yaml/
-
0755
rm
__pycache__/
-
0755
rm
cronlog.py
3773
0644
edit
dl
rm
crontab.py
46862
0644
edit
dl
rm
crontabs.py
4438
0644
edit
dl
rm
netifaces.cpython-313-x86_64-linux-gnu.so
27632
0755
edit
dl
rm
py.py
329
0644
edit
dl
rm
six.py
34703
0644
edit
dl
rm
Edit:
/usr/lib/rads/venv/lib/python3.13/site-packages/cronlog.py
(3773B)
# # Copyright 2013, Martin Owens <doctormo@gmail.com> # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 3.0 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library. # """ Access logs in known locations to find information about them. """ import os import re import codecs import platform from dateutil import parser as dateparse MATCHER = r'(?P<date>\w+ +\d+ +\d\d:\d\d:\d\d) (?P<host>\w+) ' + \ r'CRON\[(?P<pid>\d+)\]: \((?P<user>\w+)\) CMD \((?P<cmd>.*)\)' class LogReader(object): """Opens a Log file, reading backwards and watching for changes""" def __init__(self, filename, mass=4096): self.filename = filename self.mass = mass self.size = -1 self.read = -1 self.pipe = None def __enter__(self): self.size = os.stat(self.filename)[6] self.pipe = codecs.open(self.filename, 'r', encoding='utf-8') return self def __exit__(self, error_type, value, traceback): self.pipe.close() def __iter__(self): if self.pipe is None: with self as reader: for (offset, line) in reader.readlines(): yield line else: for (offset, line) in self.readlines(): yield line def readlines(self, until=0): """Iterator for reading lines from a file backwards""" if not self.pipe or self.pipe.closed: raise IOError("Can't readline, no opened file.") # Always seek to the end of the file, this accounts for file updates # that happen during our running process. location = self.size halfline = '' while location > until: location -= self.mass mass = self.mass if location < 0: mass = self.mass + location location = 0 self.pipe.seek(location) line = self.pipe.read(mass) + halfline data = line.split('\n') if location != 0: halfline = data.pop(0) loc = location + mass data.reverse() for line in data: if line.strip() == '': continue yield (loc, line) loc -= len(line) class CronLog(LogReader): """Use the LogReader to make a Cron specific log reader""" def __init__(self, filename='/var/log/syslog', user=None): LogReader.__init__(self, filename) self.user = user def for_program(self, command): """Return log entries for this specific command name""" return ProgramLog(self, command) def __iter__(self): for line in super(CronLog, self).__iter__(): match = re.match(MATCHER, str(line)) datum = match and match.groupdict() if datum and (not self.user or datum['user'] == self.user): datum['date'] = dateparse.parse(datum['date']) yield datum class ProgramLog(object): """Specific log control for a single command/program""" def __init__(self, log, command): self.log = log self.command = command def __iter__(self): for entry in self.log: if entry['cmd'] == str(self.command): yield entry
Save
cmd:
run