๐Ÿงน AgriNex Data Cleanup

โš ๏ธ Preview Mode

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

Retention Period: 90 days

Cut-off Date: 2026-01-03 15:50:33

๐Ÿ“Š Records to be Deleted:

TableRecordsAction
json_backup0 recordsDELETE WHERE backup_timestamp < 2026-01-03 15:50:33
getdata_logs0 recordsDELETE WHERE waktu_mulai < 2026-01-03 15:50:33
sensor_weather_data0 recordsDELETE WHERE received_at < 2026-01-03 15:50:33
sensor_node_data0 recordsDELETE WHERE received_at < 2026-01-03 15:50:33
node_logs0 recordsDELETE WHERE waktu < 2026-01-03 15:50:33
TOTAL0 records

๐Ÿ“… Date Range:

โœ… No Old Data Found

There are no records older than 90 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://suratuniku.my.id/api_v2/cleanup.php?days=90&confirm=yes" >> cleanup.log 2>&1