Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6845163
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T00:28:00+00:00 2026-05-27T00:28:00+00:00

I have a process that needs to do periodic processing on an ever-growing logfile.

  • 0

I have a process that needs to do periodic processing on an ever-growing logfile. Right now, the way I do this is pretty simple (I’ll include the bash script if you’re truly curious).

  • Start up tail -n0 -f $FILE
  • Each iteration:
    • Kill the tail
    • Move the old sample
    • Start up a new tail

This solves for the problem of not having any overlap, but I’m worried about the 1 or 2 lines I might miss. Is there a better way of doing this to that avoids overlap (and “under”lap)?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T00:28:00+00:00Added an answer on May 27, 2026 at 12:28 am

    By “move the old sample”, I assume you mean rotating the file by moving the current one away and replacing it with a new file.

    If so, then you could use the --follow=name option for tail instead of -f. This follows the file by name rather than the file descriptor, which allows it to continue even if the files is replaced. You can then leave your tail running while you replace the files and not miss any entries.

    For a more robust approach also include --retry, or simply use -F which implies --follow=name --retry.

    From the man page:

    -f, --follow[={name|descriptor}]

    output appended data as the file grows; -f, --follow, and --follow=descriptor are equivalent

    --retry

    keep trying to open a file even if it is inaccessible when tail starts or if it becomes inaccessible later – useful only with -f

    -F

    same as --follow=name --retry

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We have a process that needs to run every two hours. It's a process
Imagine I have a process that starts several child processes. The parent needs to
I have a timer that needs to not process its elapsed event handler at
We have a site that needs to (as part of our process) generate a
I have a process that needs to launch a child process and communicate with
I have a process, let's call it Process A, that is hosting a simple
If I have a multiprocess system that needs to process a bunch of directories,
I have a Ruby on Rails app that needs process many background jobs simultaneously:
I have a command line process that needs to use code in one of
I have a testing script that needs to open a process (a Pyro server),

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.