Difference between revisions of "Other useful scripts"

From CUC3
Jump to navigation Jump to search
import>Jss43
 
import>Jss43
Line 1: Line 1:
A place to share scripts that could be useful in many areas.
+
A place to share non-research specific scripts that could be useful to others.
   
 
= scratchrestart.pl =
 
= scratchrestart.pl =

Revision as of 19:35, 10 May 2008

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).