From 90d76defe04fac065b133ac2212c6606a73ff67a Mon Sep 17 00:00:00 2001 From: jay Date: Fri, 17 Nov 2023 03:53:42 +0000 Subject: [PATCH] Add purgedbbackups.sh Purge database backups created before any search and replace operation older than 7 days. This script will run daily via cron at midnight --- purgedbbackups.sh | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 purgedbbackups.sh diff --git a/purgedbbackups.sh b/purgedbbackups.sh new file mode 100644 index 0000000..284f595 --- /dev/null +++ b/purgedbbackups.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +# Set the path to the folder +backup_path="/var/www/webroot/mightybox-search-replace-db/db-backup" + +# Locate backup files older than 7 days and delete them +find $backup_path -type f -mtime +7 -exec rm {} \; \ No newline at end of file