FG
💻 Software

make tail wait for a file to exist

Fresh5 days ago
Mar 15, 202618911 views
Confidence Score0%
0%

Problem

would fail immediately when somefile.log does not exist. How do I make tail indefinitely wait for that file to be created (which will happen in a few moments)? Update: using , I see: because does't exist yet (it will be created in a few moments). when was created, and was touched, tail didn't pick …

Error Output

tail: cannot open `bar/somefile.log' for reading: No such file or directory
tail: cannot watch parent directory of `bar/somefile.log': No such file o…

Unverified for your environment

Select your OS to check compatibility.

1 Fix

Canonical Fix
Unverified Fix
New Fix – Awaiting Verification

Fix for: make tail wait for a file to exist

Low Risk

You're not mentioning which OS you need it for, but on linux has the --retry and --follow options that will do just that;

Awaiting Verification

Be the first to verify this fix

Sign in to verify this fix

Environment