O'Reilly logo

Linux and Unix Shell Programming by David Tansley

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

26.1. Creating hold files

Any script needs to be able to create temporary or log files. When running scripts that do backups, it is generally good practice to keep a log of the actual backup. These are usually kept in a filesystem for a few weeks and then purged by age.

When developing scripts you will be continuously creating temporary files. Temporary files are also used in normal running scripts which hold information prior to being used for input into another process. One can also use cat to display a temporary file to the screen or send it to the printer.

26.1.1. Using date to create log files

When you want to create a log file, it is always a good idea to make it unique for that day or even hour. To do this the date command comes to our ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required