Needs shell script.
This test macro deletes files older than 30 mins in the directory "/storage/emulated/0/testfolder"
If only one file exists it won't be deleted even if it's older than 30 mins.
Modify the folder and time to your liking
The script seems to work but permission is denied by the helper
24-02-28 11:28:41 - shell command complete: File più vecchi di 10 minuti eliminati.find: .: Permission denied
24-02-28 11:28:41 - Outputting line to shell
24-02-28 11:28:41 - Outputting line to shell
24-02-28 11:28:41 - Received shell script request id=14 macro=Test script script=#!/bin/bash
folder_path="/storage/emulated/0/Obtaniun export"
threshold=10
# Conta il numero di file nella cartella
file_count=$(ls -1 "$folder_path" | wc -l)
# Verifica se ci sono almeno due file prima di procedere
if [ "$file_count" -gt 1 ]; then
# Trova i file più vecchi di 10 minuti e li elimina
find "$folder_path" -type f -mmin +$threshold -exec rm {} \;
echo "File più vecchi di $threshold minuti eliminati."
else
echo "La cartella contiene un solo file. Niente da fare."
fi