MOVEDIR

NAME

movedir - Move home directory and contents

SYNOPSIS

/usr/local/bin/movedir [-yn] [-w] [user] [filesystem]

DESCRIPTION

Movedir is a shell script that will create a new top level directory and move your home directory and the files that it contains to it and then remove your original files. The purpose of movedir is to allow you to move your files from one disk to another in the event that the disk that houses your files becomes full while there are others that are not so full.

The movedir script simply executes a series of individual commands while verifying that they worked correctly. These commands are:

dfua: The dfua utility is used to display the amount of space available on the uniform access disks. If an explicit filesystem is not specified on the movedir command line, the output from dfua will be consulted to deter- mine which filesystem has the highest percentage of free space. As filesystems are not all the same size, this may not be the one with the most space available on it.

newdir: The newdir utility creates a new top level directory on the selected filesystem. If you don't tell movedir what filesystem you want to move to it will pick one for you.

cpdir: The cpdir utility copies files from one directory to another while verifying that nothing is going to be overwritten and checks the contents of the files for absolute references to your old home directory.

sethome: The sethome utility makes the new top level directory your home directory. After this utility is run you must log out and log back in again.

rm: The rm utility is used to delete the files from your old home directory so that you won't be using twice the amount of disk space as you need.

adjquota: The adjquota utility is used to redistribute your allotted disk threshold among the available disks. Your quota on each disk is determined by the amount of space you're using on the rest of the disks. After you move files from one disk to another, adjquota must be run to make sure the distribution is correct.

If any of the steps above fail in some unexpected way, the subsequent steps will not be executed. Thus if the copy fails you don't need to worry about the original files being deleted. Note, however, that if the copy fails in the middle somewhere, you may be left with multiple copies of your files. The extra copy of these files should be deleted manually.

The system may execute movedir automatically over night to level off the usage on the various filesystems to prevent any one filesystem from running out of space. If you use hard coded path names such as:

       /wg23/jonedoe/images/jupiter.jpeg
instead of:
       ~johndoe/images/jupiter.jpeg
to get to your files, this could be a problem for you. You can prevent this automated process from picking your files to move by specifying the "-n" option on the movedir command. You can later indicate that it is okay to move your files by specifying the "-y" option. No files will be moved when the -n or -y options are specified.

See also:

adjquota(1), cpdir(1), dfua(1), newdir(1), sethome(1)
Ken Lowe
Email -- ken@u.washington.edu
Web -- http://staff.washington.edu/krl/