The average delay until an IP change is detected is 2.5 minutes, regardless whether you start it at full 5 minute, or offset by a constant amount of seconds, or offset by a random amount of seconds. Think that way - if the IP changes at 12:51, without delay you would have a 4 minute delay, but when your delay happend to be 70 seconds, it would have only a 10 seconds delay.
This is true under the assumption that IP changes happen randomly - if your ISP times IP changes to always happen at the same time, it is more advisable to check at that time or one minute later.
by the way, crontab also supports 2-59/5 syntax to run at minutes 2,7,12,…
In general, yes. Running as nobody
won’t work as nobody has no write permissions anywhere except /tmp
, so you would need to create a dedicated user (and group) for it.
Difference between /bin and /sbin is not about who may put binaries there (bot only root), but who is supposed to run them (/sbin is in $PATH only for root).
If your program running as a different user needs variable files that it has to edit, the convention is to put them below a custom directory /var/{local/}spool/<programname>
or /var/{local/}/cache/<programname>
(by convention, cache may be cleared by the OS or sysadmin if it desires while spool should be preserved), and change the permissions of that directory to be group writable (or even sgid) and add your files in there.
The convention would be /opt/<programname>/bin
while other files for the same program would go to /opt/<programname>
. Note that this is not in $PATH for anybody by default, so binaries that should be ran by regular users are often symlinked elsewhere.
And while directories from the filesystem hiearchy standard need not exist, the convention for installers is to use /bin/install instead of /bin/cp to copy the files there, which will create missing directories and set the permissions correctly as well.