Skip to content

Commit

Permalink
Clean old logs on batch job
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelwitte committed Jul 14, 2024
1 parent 3045444 commit 0b3cb52
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions batchjob.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
#!/bin/bash

if [ -d "./logs" ]; then
rm -rf ./logs
fi
mkdir -p ./logs

#SBATCH -J exp_job
#SBATCH --ntasks=1
#SBATCH --nodes=1
Expand All @@ -28,6 +23,9 @@ if [ -f ml-pipeline-image_latest.sif ]; then
fi
singularity pull docker://michaelwitte/ml-pipeline-image:latest

echo "Cleaning up the logs directory..."
find ./logs -type f ! -name "slurm-$SLURM_JOB_ID.out" -delete

echo "Starting singularity execution..."

# Run the singularity container, bind the current directory to the container's working directory, bind ssh key for git
Expand Down

0 comments on commit 0b3cb52

Please sign in to comment.