Welcome to World of IPTV

Join us now to get access to all our features. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, and so, so much more. It's also quick and totally free, so what are you waiting for?

Forum Rules

Our Rules: Read to avoid getting banned!

Advertising

Introduce Yourself to the World with Us!

Resource Database

Find the newest resources around IPTV!

Account upgrade

Upgrade your account to unlock more benefits!

Set trigger to delete DB user/streams logs

Apollo

Extended Member
Ext. Member
Joined
Mar 23, 2020
Messages
4
Reaction score
16
Points
11
Location
Canada
Hi,

If you don't want your SQL server to get huge, you should set trigger that will delete old logs records:
Code:
delimiter |

CREATE EVENT IF NOT EXISTS `Clean_Old_logs`
ON SCHEDULE
    EVERY 1 DAY
COMMENT 'Clean up logs'
DO
    BEGIN
        DELETE FROM stream_logs WHERE date < (UNIX_TIMESTAMP()-60*60*24*[b]2[/b]);
        DELETE FROM client_logs WHERE date < (UNIX_TIMESTAMP()-60*60*24*[b]2[/b]);
    END |
delimiter ;

You can change "2" to any numbers of days you want to save logs for.
 
Hi,

If you don't want your SQL server to get huge, you should set trigger that will delete old logs records:
Code:
delimiter |

CREATE EVENT IF NOT EXISTS `Clean_Old_logs`
ON SCHEDULE
    EVERY 1 DAY
COMMENT 'Clean up logs'
DO
    BEGIN
        DELETE FROM stream_logs WHERE date < (UNIX_TIMESTAMP()-60*60*24*[b]2[/b]);
        DELETE FROM client_logs WHERE date < (UNIX_TIMESTAMP()-60*60*24*[b]2[/b]);
    END |
delimiter ;

You can change "2" to any numbers of days you want to save logs for.
Is this a php script saved on the server?
 
Channels MatchTime Unblock CDN Offshore Server Contact
100 cnx / 90€ 5Gbps / 180€ 48CPU-256GRAM 10Gbps 569€ Skype live:giefsl
500 cnx / 350€ 10Gbps / 350€ 48CPU-128GRAM 5Gbps / 349€ TG @changcdn
1000 cnx / 500€ 20Gbps / 700€ 40CPU-128GRAM 20Gbps / €980 http://coronaserver.com
shape1
shape2
shape3
shape4
shape5
shape6
Back
Top