Oracle - Delete dmp files from ASM diskgroup I want to delete my export files daily from ASM diskgroup with a crontab job. I want to prepare a script for it.
ASMCMD&gt; ls

exp1.dmp

exp2.dmp

exp3.dmp

exp4.dmp

ASMCMD&gt; pwd

+DATA/EXP

How can I prepare this script? I prepared a template for it, but I couldn't script it.
set_gridenv
asmcmd
cd +DATA/EXP
rm -rf exp*.dmp
exit
Best regards,
Just did a small test.
# find some ASM files
asmcmd find DATA/T101N/AUTOBACKUP/2020_09_20/ \*
+DATA/T101N/AUTOBACKUP/2020_09_20/s_1051641713.313.1051641713
+DATA/T101N/AUTOBACKUP/2020_09_20/s_1051658719.331.1051658719

# remove them one-by-one
asmcmd rm DATA/T101N/AUTOBACKUP/2020_09_20/s_1051641713.313.1051641713
asmcmd rm DATA/T101N/AUTOBACKUP/2020_09_20/s_1051658719.331.1051658719

# they are gone
asmcmd find DATA/T101N/AUTOBACKUP/2020_09_20/ \*
ASMCMD-8002: entry 'AUTOBACKUP' does not exist in directory '+DATA/T101N/'

Your scenario should be similar:
#!/bin/bash

# set grid home
. oraenv &lt;&lt;&lt; +ASM

# delete dump-files
asmcmd rm -rf DATA/EXP exp\*.dmp

Best of luck!