J
J
JuniorAdmin2021-06-08 18:15:52
ubuntu
JuniorAdmin, 2021-06-08 18:15:52

Does logrotate work without cron?

This log only works with cron, can it be run without cron?

/var/log/nginx/*.log {
    size=5M
    missingok
  rotate 7
  compress
  delaycompress
  notifempty
  create 0644 www-data adm
  sharedscripts
   postrotate
    invoke-rc.d nginx rotate >/dev/null>
  endscript
}

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Vitsliputsli, 2021-06-08
@JuniorAdmin

Why not? Cron, no matter what you run, remove logrotate from the cron run and add it wherever you see fit.

V
Vitaly Karasik, 2021-06-09
@vitaly_il1

If the question is how to run logrotate more than once a day? - then the answer is:
through cron again.
For example
*/10 * * * * logrotate /etc/logrotate.conf
every ten minutes

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question