Hello friends,
I'm trying to configure a script the deletes the file and directories with more than 10 weeks on my /tmp directory, this is what i'm trying to do:
Quote:
#!/bin/bash
#Script para borrado de ficheros y PDFs de /tmp
### Directorios/PDFs a borrar
DIRfaxjob="/usr/bin/find /tmp/faxjob* -mtime +70"
if `$DIRfaxjob`
then
result=$?
case $result in
0) /usr/bin/find /tmp -mtime +70 -exec rm -f {} \; ;;
*) echo_error "=> No existen archivos con mayor antiguedad de 10 semanas;;
esac
else
echo Intentalo luego
fi
|
Is this OK? i think i'm having problems with my "result=$?"
could you please let me know what can i do to make this more logical?
THANKS!