A backup script that runs on several Linux systems recently produced the following error:
ls: cannot access '/tmp/sortrq9hq8': No such file or directory
It happens every time the backup runs. Other than the above message, there seems to be no ill effect on the backup, which completes successfully. The ls command did not find a file that it expected to be there.
This article explains how the missing file was created by the Linux sort command as a temporary storage area, how error messages about these files are likely to crop up from time to time, how to reproduce the error, and some background about the behaviour of the sort command on Linux and Solaris. Continue reading →
Command substitution is a widely used feature of the Bash and Korn shells, allowing the output of one command to be captured and used in another. Like this:
$ echo "Backup started at $(date)"
Backup started at Fri Mar 16 15:35:14 GMT 2012
Command substitution is not to be confused with that less well known (and, to be honest, less useful) shell feature, process substitution. Despite being rarely used, process substitution is worth knowing about, if only because it illuminates other fundamental unix features – the shell, sub processes, named and unnamed pipes.
This post discusses process substitution, command substitution and the vertical bar (|). Three very different shell features, but all making use of unnamed pipes, and so not as different as they first appear. The examples are from Linux but also work on Solaris 10 and, due to the ubiquity of pipes, are likely to work on other unixes too. Continue reading →
Copying data is something every administrator does. A single file or directory file can be copied with a single command. Moving information from one system to another needs a bit more work, but it needn’t be a pain.
The ssh command can be used to copy data from one Unix system to another. Here is an example for HP-UX, but it works on Linux too. A directory, called /var/opt/ignite, is copied from the system “pluto” to another machine called “jupiter”. Continue reading →