Skip to content

Instantly share code, notes, and snippets.

@andronex
Created September 2, 2020 20:53
Show Gist options
  • Save andronex/c4f3e725481a21c515c71173e1edca95 to your computer and use it in GitHub Desktop.
Save andronex/c4f3e725481a21c515c71173e1edca95 to your computer and use it in GitHub Desktop.
Очистка таблицы сессий MODX Revolution
#!/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