No, sourcing a file or running a script daily, hourly or even every minute, is in itself not "dangerous", but it depends on what the script is doing.
For example, a script that creates temporary files, fills them with data and does not clean up after itself will, eventually, fill up a partition.
A file that modifies environment variables may blindly add values to e.g. PATH
without testing whether those values are not already part of $PATH
. Eventually, such a script would make it difficult to execute utilities on the command line if it was sourced many many times (the length of the command line plus the length of all environment variables and their values is limited to a particular value).
Some disk media is susceptible to wear, and some users go to great lengths to not write things to the physical disk (mounting filesystems in RAM, turning off write access on as many other mount points as possible etc). On such systems, the act of creating a file every minute may be considered less good (possibly depending on the size of the file)
The take-home message here is this: Sourcing or running a script often is not bad practice, depending on what it does. Making sure that scripts that you write does proper cleaning up and are able to detect when it's appropriate to make certain modifications is also good practice.
PATH=/foo/bar:$PATH
). – NickD Feb 14 '18 at 12:47