Skip to main content
added 13 characters in body
Source Link
muru
  • 78.4k
  • 16
  • 214
  • 320

I'm really struggling to understand how logrotate works when running a command within a shell file of my own, and how it doesn't.

The command in question is:

rclone -L -vv --log-file "/home/mike/tmp/qqq.log"  sync "/media/mike/W10 D drive/My Documents/"  remote:MyDocuments_M17A_from_Linux

What I would like:
I

I would like this qqq.log file to be checked quite often, say every 10 min., to see whether it has exceeded a given size, say 1 MB. And if it has, to rotate the file. rclone with the -vv option produces copious output, deliberately (i.e. to try to understand to get logrotate working for this use case).

There's a moderately helpful tutorial here, but it still leaves me in the dark:

  1. How are you meant to configure rotation of logs from your own non-system processes? Are you meant to stick lines at the bottom of /etc/logrotate.conf? This is what I have done (under "#system-specific logs may be configured here"):

    /home/mike/tmp/qqq.log { notifempty size 1M daily create 0664 root root rotate 3 }
    later: I now realise you can also put individual files in /etc/logrotate.d - no great complexity there.

  2. Is it the case that by default logrotate only runs once a day, by virtue of the file /etc/cron.daily/logrotate?

  3. Does that mean that if I want much more frequent checking I should perhaps set up a cron job to do this, running (in this example) every 10 minutes?

  4. Are you meant to run logrotate <config file> as root? I ask this question because I have tried both as root and as user. User didn't seem to work.

    /home/mike/tmp/qqq.log {
      notifempty
      size 1M
      daily
      create 0664 root root
      rotate 3
    }
    

later: I now realise you can also put individual files in /etc/logrotate.d - no great complexity there.

  1. Is it the case that by default logrotate only runs once a day, by virtue of the file /etc/cron.daily/logrotate?

  2. Does that mean that if I want much more frequent checking I should perhaps set up a cron job to do this, running (in this example) every 10 minutes?

  3. Are you meant to run logrotate <config file> as root? I ask this question because I have tried both as root and as user. User didn't seem to work.

A link to a beginner's guide to this sort of setup, which can't be that uncommon, would be helpful. I have searched but most of what I've found doesn't give you a step-by-step guide.

I'm really struggling to understand how logrotate works when running a command within a shell file of my own, and how it doesn't.

The command in question is:

rclone -L -vv --log-file "/home/mike/tmp/qqq.log"  sync "/media/mike/W10 D drive/My Documents/"  remote:MyDocuments_M17A_from_Linux

What I would like:
I would like this qqq.log file to be checked quite often, say every 10 min., to see whether it has exceeded a given size, say 1 MB. And if it has, to rotate the file. rclone with the -vv option produces copious output, deliberately (i.e. to try to understand to get logrotate working for this use case).

There's a moderately helpful tutorial here, but it still leaves me in the dark:

  1. How are you meant to configure rotation of logs from your own non-system processes? Are you meant to stick lines at the bottom of /etc/logrotate.conf? This is what I have done (under "#system-specific logs may be configured here"):

    /home/mike/tmp/qqq.log { notifempty size 1M daily create 0664 root root rotate 3 }
    later: I now realise you can also put individual files in /etc/logrotate.d - no great complexity there.

  2. Is it the case that by default logrotate only runs once a day, by virtue of the file /etc/cron.daily/logrotate?

  3. Does that mean that if I want much more frequent checking I should perhaps set up a cron job to do this, running (in this example) every 10 minutes?

  4. Are you meant to run logrotate <config file> as root? I ask this question because I have tried both as root and as user. User didn't seem to work.

A link to a beginner's guide to this sort of setup, which can't be that uncommon, would be helpful. I have searched but most of what I've found doesn't give you a step-by-step guide.

I'm really struggling to understand how logrotate works when running a command within a shell file of my own, and how it doesn't.

The command in question is:

rclone -L -vv --log-file "/home/mike/tmp/qqq.log"  sync "/media/mike/W10 D drive/My Documents/"  remote:MyDocuments_M17A_from_Linux

What I would like:

I would like this qqq.log file to be checked quite often, say every 10 min., to see whether it has exceeded a given size, say 1 MB. And if it has, to rotate the file. rclone with the -vv option produces copious output, deliberately (i.e. to try to understand to get logrotate working for this use case).

There's a moderately helpful tutorial here, but it still leaves me in the dark:

  1. How are you meant to configure rotation of logs from your own non-system processes? Are you meant to stick lines at the bottom of /etc/logrotate.conf? This is what I have done (under "#system-specific logs may be configured here"):

    /home/mike/tmp/qqq.log {
      notifempty
      size 1M
      daily
      create 0664 root root
      rotate 3
    }
    

later: I now realise you can also put individual files in /etc/logrotate.d - no great complexity there.

  1. Is it the case that by default logrotate only runs once a day, by virtue of the file /etc/cron.daily/logrotate?

  2. Does that mean that if I want much more frequent checking I should perhaps set up a cron job to do this, running (in this example) every 10 minutes?

  3. Are you meant to run logrotate <config file> as root? I ask this question because I have tried both as root and as user. User didn't seem to work.

A link to a beginner's guide to this sort of setup, which can't be that uncommon, would be helpful. I have searched but most of what I've found doesn't give you a step-by-step guide.

added 2 characters in body
Source Link
mike rodent
  • 1.2k
  • 3
  • 13
  • 26

I'm really struggling to understand how logrotate works when running a command within a shell file of my own, and how it doesn't.

The command in question is:

rclone -L -vv --log-file "/home/mike/tmp/qqq.log"  sync "/media/mike/W10 D drive/My Documents/"  remote:MyDocuments_M17A_from_Linux

What I would like:
I would like this qqq.log file to be checked quite often, say every 10 min., to see whether it has exceeded a given size, say 1 MB. And if it has, to rotate the file. rclone with the -vv option produces copious output, deliberately (i.e. to try to understand to get logrotate working for this use case).

There's a moderately helpful tutorial here, but it still leaves me in the dark:

  1. How are you meant to configure rotation of logs from your own non-system processes? Are you meant to stick lines at the bottom of /etc/logrotate.conf? This is what I have done (under "#system-specific logs may be configured here"):

    /home/mike/tmp/qqq.log { notifempty size 1M daily create 0664 root root rotate 3 }
    later: I now realise you can also put individual files in /etc/logrotate.d - no great complexity there.

  2. Is it the case that by default logrotate only runs once a day, by virtue of the file /etc/cron.daily/logratelogrotate?

  3. Does that mean that if I want much more frequent checking I should perhaps set up a cron job to do this, running (in this example) every 10 minutes?

  4. Are you meant to run logrotate <config file> as root? I ask this question because I have tried both as root and as user. User didn't seem to work.

A link to a beginner's guide to this sort of setup, which can't be that uncommon, would be helpful. I have searched but most of what I've found doesn't give you a step-by-step guide.

I'm really struggling to understand how logrotate works when running a command within a shell file of my own, and how it doesn't.

The command in question is:

rclone -L -vv --log-file "/home/mike/tmp/qqq.log"  sync "/media/mike/W10 D drive/My Documents/"  remote:MyDocuments_M17A_from_Linux

What I would like:
I would like this qqq.log file to be checked quite often, say every 10 min., to see whether it has exceeded a given size, say 1 MB. And if it has, to rotate the file. rclone with the -vv option produces copious output, deliberately (i.e. to try to understand to get logrotate working for this use case).

There's a moderately helpful tutorial here, but it still leaves me in the dark:

  1. How are you meant to configure rotation of logs from your own non-system processes? Are you meant to stick lines at the bottom of /etc/logrotate.conf? This is what I have done (under "#system-specific logs may be configured here"):

    /home/mike/tmp/qqq.log { notifempty size 1M daily create 0664 root root rotate 3 }
    later: I now realise you can also put individual files in /etc/logrotate.d - no great complexity there.

  2. Is it the case that by default logrotate only runs once a day, by virtue of the file /etc/cron.daily/lograte?

  3. Does that mean that if I want much more frequent checking I should perhaps set up a cron job to do this, running (in this example) every 10 minutes?

  4. Are you meant to run logrotate <config file> as root? I ask this question because I have tried both as root and as user. User didn't seem to work.

A link to a beginner's guide to this sort of setup, which can't be that uncommon, would be helpful. I have searched but most of what I've found doesn't give you a step-by-step guide.

I'm really struggling to understand how logrotate works when running a command within a shell file of my own, and how it doesn't.

The command in question is:

rclone -L -vv --log-file "/home/mike/tmp/qqq.log"  sync "/media/mike/W10 D drive/My Documents/"  remote:MyDocuments_M17A_from_Linux

What I would like:
I would like this qqq.log file to be checked quite often, say every 10 min., to see whether it has exceeded a given size, say 1 MB. And if it has, to rotate the file. rclone with the -vv option produces copious output, deliberately (i.e. to try to understand to get logrotate working for this use case).

There's a moderately helpful tutorial here, but it still leaves me in the dark:

  1. How are you meant to configure rotation of logs from your own non-system processes? Are you meant to stick lines at the bottom of /etc/logrotate.conf? This is what I have done (under "#system-specific logs may be configured here"):

    /home/mike/tmp/qqq.log { notifempty size 1M daily create 0664 root root rotate 3 }
    later: I now realise you can also put individual files in /etc/logrotate.d - no great complexity there.

  2. Is it the case that by default logrotate only runs once a day, by virtue of the file /etc/cron.daily/logrotate?

  3. Does that mean that if I want much more frequent checking I should perhaps set up a cron job to do this, running (in this example) every 10 minutes?

  4. Are you meant to run logrotate <config file> as root? I ask this question because I have tried both as root and as user. User didn't seem to work.

A link to a beginner's guide to this sort of setup, which can't be that uncommon, would be helpful. I have searched but most of what I've found doesn't give you a step-by-step guide.

Became Hot Network Question
deleted 155 characters in body
Source Link
mike rodent
  • 1.2k
  • 3
  • 13
  • 26

I'm really struggling to understand how logrotate works when running a command within a shell file of my own, and how it doesn't.

The command in question is:

rclone -L -vv --log-file "/home/mike/tmp/qqq.log"  sync "/media/mike/W10 D drive/My Documents/"  remote:MyDocuments_M17A_from_Linux

What I would like:
I would like this qqq.log file to be checked quite often, say every 10 min., to see whether it has exceeded a given size, say 1 MB. And if it has, to rotate the file. rclone with the -vv option produces copious output, deliberately (i.e. to try to understand to get logrotate working for this use case).

There's a moderately helpful tutorial here, but it still leaves me in the dark:

  1. How are you meant to configure log rotation of logs from your own non-system processes? Are you meant to stick lines at the bottom of /etc/logrotate.conf? This is what I have done (under "#system-specific logs may be configured here"):

    /home/mike/tmp/qqq.log { notifempty size 1M daily create 0664 root root rotate 3 }
    later: I now realise you can also put individual files in /etc/logrotate.d - no great complexity there.

  2. Is it the case that by default logrotate only runs once a day, by virtue of the file /etc/cron.daily/lograte?

  3. Does that mean that if I want much more frequent checking I should perhaps set up a cron job to do this, running (in this example) every 10 minutes?

  4. Are you meant to run logrotate <config file> as root? I ask this question because I have tried both as root and as user. User didn't seem to work.

A link to a beginner's guide to this sort of setup, which can't be that uncommon, would be helpful. I have searched but most of what I've found doesn't give you a step-by-step guide.

I'm really struggling to understand how logrotate works when running a command within a shell file of my own, and how it doesn't.

The command in question is:

rclone -L -vv --log-file "/home/mike/tmp/qqq.log"  sync "/media/mike/W10 D drive/My Documents/"  remote:MyDocuments_M17A_from_Linux

What I would like:
I would like this qqq.log file to be checked quite often, say every 10 min., to see whether it has exceeded a given size, say 1 MB. And if it has, to rotate the file. rclone with the -vv option produces copious output, deliberately (i.e. to try to understand to get logrotate working for this use case).

There's a moderately helpful tutorial here, but it still leaves me in the dark:

  1. How are you meant to configure log rotation from your own non-system processes? Are you meant to stick lines at the bottom of /etc/logrotate.conf? This is what I have done (under "#system-specific logs may be configured here"):

    /home/mike/tmp/qqq.log { notifempty size 1M daily create 0664 root root rotate 3 }

  2. Is it the case that by default logrotate only runs once a day, by virtue of the file /etc/cron.daily/lograte?

  3. Does that mean that if I want much more frequent checking I should perhaps set up a cron job to do this, running (in this example) every 10 minutes?

  4. Are you meant to run logrotate <config file> as root? I ask this question because I have tried both as root and as user. User didn't seem to work.

A link to a beginner's guide to this sort of setup, which can't be that uncommon, would be helpful. I have searched but most of what I've found doesn't give you a step-by-step guide.

I'm really struggling to understand how logrotate works when running a command within a shell file of my own, and how it doesn't.

The command in question is:

rclone -L -vv --log-file "/home/mike/tmp/qqq.log"  sync "/media/mike/W10 D drive/My Documents/"  remote:MyDocuments_M17A_from_Linux

What I would like:
I would like this qqq.log file to be checked quite often, say every 10 min., to see whether it has exceeded a given size, say 1 MB. And if it has, to rotate the file. rclone with the -vv option produces copious output, deliberately (i.e. to try to understand to get logrotate working for this use case).

There's a moderately helpful tutorial here, but it still leaves me in the dark:

  1. How are you meant to configure rotation of logs from your own non-system processes? Are you meant to stick lines at the bottom of /etc/logrotate.conf? This is what I have done (under "#system-specific logs may be configured here"):

    /home/mike/tmp/qqq.log { notifempty size 1M daily create 0664 root root rotate 3 }
    later: I now realise you can also put individual files in /etc/logrotate.d - no great complexity there.

  2. Is it the case that by default logrotate only runs once a day, by virtue of the file /etc/cron.daily/lograte?

  3. Does that mean that if I want much more frequent checking I should perhaps set up a cron job to do this, running (in this example) every 10 minutes?

  4. Are you meant to run logrotate <config file> as root? I ask this question because I have tried both as root and as user. User didn't seem to work.

A link to a beginner's guide to this sort of setup, which can't be that uncommon, would be helpful. I have searched but most of what I've found doesn't give you a step-by-step guide.

deleted 155 characters in body
Source Link
mike rodent
  • 1.2k
  • 3
  • 13
  • 26
Loading
Source Link
mike rodent
  • 1.2k
  • 3
  • 13
  • 26
Loading