smk (12/31/82)
Let me summarize the squish discussion and then we can call it quits. (But from experience, it never is!) Those of you who use tar/cpio to do the same thing will run into trouble if you don't have enough space to hold a copy of the hierachy you want to move. Thus, you shell scripts should first do a df and compare it to the du on the hierarchy. It's slow and messy and should fail with just a little space left. My neighbors have a tight space problem and couldn't use the tar/cpio solution. Except for the .. problem on subdirectories, uusquish works fine for /usr/spool/uucp. Squish is more general purpose and works (recursively if you want) on directories not containing a mountable file system. Both squish and uusquish have problems when someone happens to be in the hierarchy you are dealing with, so the best bet is to run them right after the mounts (and cleanups) in /etc/rc. For this reason, I would like to see a squish system call. Only in the kernel can you check to see if it is OK to do (similar checking on the mount/umount calls is already there to use). If a system call were provided, /usr/lib/crontab could run a find / -file d -a -exec squish {} ";" every nite. Squish in this case would simply call the squish system call (which would look like squish (dirname);) Those of you who want to stick to shell scripts, fine. I don't care. If you want squish, it's there for you. Let's stop the bickering. BTW-- Mkdir suffers the similar problems to squish. If you kill it at the right moment, the directory is made without the . and .. entries. This should be a kernel function also. Sure, mkdir works OK, but if there are possible bugs, let's fix them correctly. Since the kernel understands about . and .., why not move mkdir there also? The System III cpio has a bug which I will post soon.
ka (01/03/83)
I had been hoping to stay clear of this discussion, but the arti- cle by linus!smk has finally goaded me into a response. Those of you who use tar/cpio to do the same thing will run into trouble if you don't have enough space to hold a copy of the hierachy you want to move. Tar has this problem, but not cpio. The command sequence is: cd dir mkdir ../tempdir find . -print | cpio -pdl ../tempdir cd .. rm -r dir mv tempdir dir The -l option causes cpio to simply link the files rather than copying them. Squish is more general purpose and works (recursively if you want) on directories not containing a mountable file system. So does cpio. Both squish and uusquish have problems when someone happens to be in the hierarchy you are dealing with, so the best bet is to run them right after the mounts (and cleanups) in /etc/rc. For this reason, I would like to see a squish system call. Please! A conscious effort was made in designing UNIX to keep the number of system calls to a minimum. Surely you can get by with running squish only when you back up the system. If not, the solution is to redesign the way UNIX directory system so squ- ish is unnecessary, NOT to clutter up UNIX with another system call. Mkdir suffers the similar problems to squish. If you kill it at the right moment, the directory is made without the . and .. entries. This should be a kernel function also. My feelings about adding another system call are given above. Also, in System III there is no way to kill mkdir (which runs suid) unless you are root. Kenneth Almquist