name="nginx.log"
data=$(date +%Y.%m.%d)
current_nginx=$name.$data
cd /var/log/
for i in `ls $name*`; do
if [[ $i != *".gz"* ]] && [[ $i != "$current_nginx" ]]; then
gzip $i
echo "make compressing for $i"
fi
echo "there are not available nginx logs. stop the script executing"
exit 1
done
SELECT DISTINCT `page_id` WHERE ...
4.1.1.1. Extended HELLO (EHLO) or HELLO (HELO)
These commands are used to identify the SMTP client to the SMTP server. The argument clause contains the fully-qualified domain name of the SMTP client, if one is available. In situations in which the SMTP client system does not have a meaningful domain name (e.g., when its address is dynamically allocated and no reverse mapping record is available), the client SHOULD send an address literal (see Section 4.1.3).
...ehlo = "EHLO" SP ( Domain / address-literal ) CRLF
WHERE `event_date` < NOW() + INTERVAL 45 MINUTE
WHERE `event_date` < NOW() + INTERVAL 45 MINUTE AND `event_fired` = 0
DELETE FROM `session` WHERE `time` >= UNIX_TIMESTAMP() - 86400
CREATE TRIGGER `votes_after_insert` AFTER INSERT ON `votes` FOR EACH ROW
BEGIN
INSERT INTO `items`
(`id`, `rating1`, `rating2`, `rating3`, `rating4`, `votes_count`)
SELECT `item_id`, AVG(`rating1`), AVG(`rating2`),
AVG(`rating3`), AVG(`rating4`), COUNT(*)
FROM `votes`
WHERE `item_id` = NEW.`item_id`
ON DUPLICATE KEY UPDATE
`rating1` = VALUES(`rating1`), `rating2` = VALUES(`rating2`),
`rating3` = VALUES(`rating3`), `rating4` = VALUES(`rating4`),
`votes_count` = VALUES(`votes_count`);
END