From defa5b218ee76c7cee6b4dde54601b236e28516a Mon Sep 17 00:00:00 2001 From: David Kinzer Date: Tue, 27 May 2025 09:53:06 -0400 Subject: [PATCH] Delete old backup directories. --- cob_datapipeline/backup_collections_dag.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cob_datapipeline/backup_collections_dag.py b/cob_datapipeline/backup_collections_dag.py index b90ea906..458d572e 100644 --- a/cob_datapipeline/backup_collections_dag.py +++ b/cob_datapipeline/backup_collections_dag.py @@ -50,7 +50,7 @@ def backup_collections(collections: list): delete_task = SSHOperator( task_id="delete_old_solr_backups", ssh_conn_id="SOLR_NETWORKED_DRIVE", - command="sudo find /backups/ -type f -mtime +30 -exec rm {} \\;", + command="sudo find /backups/ -type d -mindepth 1 -maxdepth 1 -mtime +30 -exec rm -rf {} +", cmd_timeout=None, )