User Tools

Site Tools


autorslpbsremovaltool

Auto-Remove Tool for pbs.o, rsl.out and rsl.error Files

After a WRF run, one usually needs to inspect and then remove rsl.out, rsl.error and PBS output files. In order to quickly remove these files, make a file in the test/em_real directory (call it remove.sh or something like that) and copy the following into it:

#!/bin/bash

read -p "Are you sure you want to delete? " -n 1 -r
if [[ $REPLY =~ ^[Yy]$ ]]
then
   /bin/rm rsl.error*
   echo ""
   echo "Removed all rsl.error files"
   /bin/rm rsl.out*
   echo "Removed all rsl.out files"
   /bin/rm *pbs.o3*
   echo "Removed all PBS.o files"
fi

Save the file, then chmod u+x filename in order to make it executable. You will only need to confirm once with a Y or y that you actually want to remove the files.

Another option is to write a script that removes all rsl* files except rsl.out.0000 and rsl.error.0000. For example:

#!/bin/bash

read -p "Deleting all rsl.* files except those ending in 0000. OK? " -n 1 -r
if [[ $REPLY =~ ^[Yy]$ ]]
    then
        /bin/rm rsl.*.00[^0]*
        /bin/rm rsl.*.000[^0]
    else
        echo
        echo
        echo "Sorry, didn't catch that. Please try again and answer with 'y'."
        exit 1
fi
autorslpbsremovaltool.txt · Last modified: 2012/10/10 15:53 by chris