๐Ÿงน AgriNex Data Cleanup

โš ๏ธ Preview Mode

This will show what data will be deleted if you proceed.

Retention Period: 180 days

Cut-off Date: 2025-10-05 15:50:32

๐Ÿ“Š Records to be Deleted:

TableRecordsAction
json_backup0 recordsDELETE WHERE backup_timestamp < 2025-10-05 15:50:32
getdata_logs0 recordsDELETE WHERE waktu_mulai < 2025-10-05 15:50:32
sensor_weather_data0 recordsDELETE WHERE received_at < 2025-10-05 15:50:32
sensor_node_data0 recordsDELETE WHERE received_at < 2025-10-05 15:50:32
node_logs0 recordsDELETE WHERE waktu < 2025-10-05 15:50:32
TOTAL0 records

๐Ÿ“… Date Range:

โœ… No Old Data Found

There are no records older than 180 days to delete.

All data is within the retention period.

๐Ÿ’ก Recommendations:

Change retention period:

30 Days60 Days90 Days180 Days

โฐ Setup Automatic Cleanup (Cron Job):

Add this to your crontab to run cleanup weekly:

# Run every Sunday at 2 AM
0 2 * * 0 php /home/surn4175/public_html/api_v2/cleanup.php days=90 confirm=yes >> /home/surn4175/public_html/api_v2/cleanup.log 2>&1

Or via web:

0 2 * * 0 curl "https://www.suratuniku.my.id/api_v2/cleanup.php?days=90&confirm=yes" >> cleanup.log 2>&1