A
A
Alexey Tutubalin2020-06-04 10:43:14
PHP
Alexey Tutubalin, 2020-06-04 10:43:14

How to deal with the rotation of personal logs?

There is a directory with storage of txt files with unsuccessful login attempts (ip and date), file sizes from 38 to 200 bytes, I wanted to compress each of them in zip at the end of the day, but the archive weighs more than the file itself (for me it is it turns out stupid), but I want to store as many files as possible, just in case the place allows, how to organize their rotation? I already think I can take them for the last 10 days (as they accumulate) and into 1 archive? Can someone suggest something more reasonable? So far there are only 30 of them, but I want to automate them by adding them to the scheduler, and not think about it

Answer the question

In order to leave comments, you need to log in

5 answer(s)
S
sl0, 2020-06-04
@Kennius

1. How can an archive with txt weigh more than the file itself? That doesn't happen.
2. Run a cron script that will create a new archive and delete the oldest one. Recently there was a similar question How to delete files from the server after a month?

F
FanatPHP, 2020-06-04
@FanatPHP

The log is one file, not 100500 small ones.

O
Optimus, 2014-06-11
@sergoby

Learn HTML first
www.postroika.ru/html
htmlbook.ru
Then learn PHP
microsin.net/programming/HTML/php-examples.html
www.puzzleweb.ru/php/17_if_else.php
www.php.su/books/?php
www.eltisbook.ru/php/obrabotka-form.php
www.site-do.ru/php/uroki_php.php
2develop.ru/category/phpmysql
life-prog.ru/view_cat.php?cat=6&page=1
phpblog. su
dnzl.ru/view_cat.php?cat=4
www.codeharmony.ru/sections/php
See this channel www.youtube.com/user/IllyaLoshek/playlists
Then OOP PHP
www.php.net/manual/ru/language. oop5.php
www.php.su/learnphp/phpoo/?php5
www.codeharmony.ru/materials/49
www.codeharmony.ru/materials/51
www.php-spravka.ru/showall/2/1
www.internet-technologies.ru/articles/article_773....
and phpblog.su OOP section
Then frameworks, but not with symfony2 I would advise you to start, by this time you yourself will find the necessary information about frameworks in general ))

Y
Yuri Morozov, 2014-06-11
@metamorph

From learning html, php, sql.
Then switch to symfony2.
Then...
No, are you serious?..

V
Viktor Vsk, 2014-06-11
@viktorvsk

Solving the problem of sending messages is not difficult.
Learning symphony, or even just applying it in this case, can depend on a million of your personality factors.
To directly answer the question (where to start?), I would say this:
Start by solving this problem (about sending messages, the server, etc.) in any language and any shit code. And when you finish it, everything will work and you will understand what kind of mess it turned out - decide for yourself whether it would be better to use some kind of framework and best practices.
If you came to an internship, you were given a task and you don’t even know where to start ... It seems that somewhere they advertise a lot the phrase:
"Programming is easy:
1) You choose a popular framework.
2) You ask a question on a toaster .
3) PROFIT."

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question