Lo tengo codificado en UTF-8 y hecho por NotePad, luego lo subí por SFTP y ejecutado por SSH
Código:
root@venad1:~# ./fixp.sh
: No such file or directoryh
./fixp.sh: line 2: $'\r': command not found
./fixp.sh: line 6: $'\r': command not found
du: cannot access `/_network\r': No such file or directory
./fixp.sh: line 9: $'\r': command not found
./fixp.sh: line 13: syntax error near unexpected token `fi'
./fixp.sh: line 13: `fi'
root@venad1:~#
Código
#!/bin/sh # 100GB SIZE LIMIT SIZE=0,5 MY_DIR="/_network" # check the current size CHECK=$(du -bs $MY_DIR|awk '{print $1}') #output Bytes if [ $CHECK -gt $SIZE ]; then echo "ACTION" # find $MY_DIR -mindepth 0 -maxdepth 3 -mtime +1 -type f -exec rm {} \; fi