The following example will be able to delete files, which last modification day was 2 days ago: #!/bin/sh ############################################### ## Shell script to run housekeep logs ## ## delete aaa.log older than x days ago ## ############################################### ##declaring variables echo “HOUSEKEEP started…” LOG_PATH=/home/xxx/logs PAST=2 find $LOG_PATH -mtime +$PAST -type f -exec rm -rf {} \; echo “HOUSEKEEP ends…”
