Last active
June 29, 2020 16:40
-
-
Save aruethe2/c24555dcd11fa7ffbe921e95c32573d9 to your computer and use it in GitHub Desktop.
Script to clean up garbage files after Gaussian jobs have been run on Strelka. Written by Paul Rablen.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/perl | |
# Script to clean up garbage files after Gaussian jobs have been run on strelka. | |
# (Written by Paul Rablen, June 2020) | |
# Find all the files of the form gaussian.#.* | |
#numjobs = 0; | |
opendir(THISDIR, "."); | |
@allfiles = readdir THISDIR; | |
closedir THISDIR; | |
foreach $file (@allfiles) { | |
if (substr($file,0,9) eq "gaussian.") { | |
# Get location of second "." | |
$i = index($file,".",9); | |
$j = $i-9; | |
# Get the job ID number. | |
$job[$numjobs] = substr($file,9,$j); | |
$numjobs++; | |
} | |
} | |
# Now delete the files associated with these jobs. | |
$uname=`whoami`; | |
chomp($uname); | |
for ($i=0; $i<$numjobs; $i++) { | |
print "rm gaussian.$job[$i].out\n"; | |
`rm gaussian.$job[$i].out`; | |
print "rmdir /home/$uname/$job[$i]\n"; | |
`rmdir /home/$uname/$job[$i]`; | |
} | |
print "rm fort.7\n"; | |
print `rm fort.7`; | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment