Created
September 2, 2020 20:53
-
-
Save andronex/c4f3e725481a21c515c71173e1edca95 to your computer and use it in GitHub Desktop.
Очистка таблицы сессий MODX Revolution
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#запускать скрипт каждую ночь | |
/usr/bin/mysql -pПАРОЛЬ -uЛОГИН ИМЯ_БД <<EOF | |
DELETE FROM modx_session WHERE access <UNIX_TIMESTAMP(DATE_SUB(now(), INTERVAL 4 DAY)); #удалять записи старше 4-х дней | |
OPTIMIZE TABLE modx_session; | |
EOF |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment