Quote Originally Posted by udragu View Post
but the main Idea is to get date postfactum. For example, some script was started.Duration two weeks, just for fun). Execution of it was completed or interrupted(may be power outage was happened). And I need to know was result successful or not.
I would use a simple lockfile for that.
Lockfiles are usually placed in /run/lock, though that's merely a convention. That directory is destroyed at reboot, so choose a different location if you want persistence.

When the script starts, it creates the lockfile (file creation time = start time)
When the script ends, it logs completion (including start time and end time, if desired) in /var/log and deletes the lockfile.
If the script starts and detects an existing lockfile, you know that a previous instance of the script did not terminate (yet).
If there is no lockfile, previous run was successful.