Other useful scripts
Revision as of 19:40, 10 May 2008 by import>Jss43 (→scratchrestart.pl)
A place to share non-research specific scripts that could be useful to others.
scratchrestart.pl
A common issue is running over quota on the clusters, due to each calculation generating a large file (e.g. CPMD RESTART files). scratchrestart.pl attempts to solve this by searching recursively through the directory tree (from the working directory) and moving all files matching a regular expression to a scratch disk, leaving behind a symbolic link to the file's new location and leaving all other files untouched. Warning: you will be asked for confirmation *only* once.
# scratchrestart.pl --help usage: scratchrestart.pl [regular expression] Search all files matching the regular expression (default: RESTART) contained in the the current directory and all subdirectories and move them to scratch, leaving behind a symbolic link to the file now in scratch. The directory structure is preserved in scratch. e.g. The file /home/jss43/RUN/RESTART.1 is moved to /scratch/jss43/RUN/RESTART.1. Files are only moved if they are not symbolic links, so it is safe to do multiple times (a run only moves the files that have been generated since the last run).
This is used for moving files to /storage on tardis: you will need to change the value of the $scratch variable to be the name of your scratch disk.