Skip to content

remove files older than 7 days

we can use a simple one line for this:

#!/bin/sh

VERZ=”/home/cobackup/wiki/”
ALTER=”7″

cd $VERZ

find . -mtime +$ALTER -exec rm {} \;

and we can edit crontab  running this script every day

0 22 * * * /bin/sh /root/scripts/delfile.sh > /dev/null 2>&1