mirror of
https://github.com/stefanpejcic/openpanel
synced 2025-06-26 18:28:26 +00:00
Create delete_cron.sh
This commit is contained in:
parent
82e2975c38
commit
71bf8a1496
15
services/proxy/delete_cron.sh
Normal file
15
services/proxy/delete_cron.sh
Normal file
@ -0,0 +1,15 @@
|
||||
#!/bin/bash
|
||||
|
||||
BASE_PATH="/var/www/html/domains"
|
||||
LOG_FILE="/var/www/delete.log"
|
||||
CURRENT_DATE=$(date '+%Y-%m-%d %H:%M:%S')
|
||||
|
||||
# Find and delete config.php files older than 15 minutes
|
||||
find "$BASE_PATH"/*/config.php -type f -mmin +15 | while read -r file; do
|
||||
# Log the deletion
|
||||
echo "[$CURRENT_DATE] Deleted config.php on path '$file' - It was older than 15 minutes." >> "$LOG_FILE"
|
||||
rm -f "$file"
|
||||
done
|
||||
|
||||
exit 0
|
||||
|
Loading…
Reference in New Issue
Block a user