Python script to get rid of old entries in Nextclouds oc_files_lock table created by rakurtz in 2024
pip install mysql-connector-python
create an unpriviled user for this task!
CREATE USER 'cleanup_user'@'localhost' IDENTIFIED BY 'some_password';
GRANT SELECT, DELETE ON nextcloud.oc_files_lock TO 'cleanup_user'@'localhost';
# My script params
time_delta_in_hours = 24
notify_to_email = "[email protected]"
0 0 * * * /usr/bin/python3 /path/to/cleanup_oc_files_lock.py