#!/bin/bash
#####################
#
#This is a auto del file when that is old then 7 days
#
####################
#
#load PATH
#
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
export PATH
####################
#
#Program :
#
###################
#setting doc
doc=/tmp/

#setting search data type
#              b      block (buffered) special
#              c      character (unbuffered) special
#              d      directory
#              p      named pipe (FIFO)
#              f      regular file
#              l      symbolic link
#              s      socket
#              D      door (Solaris)
datatype="f"

#setting days that how long before
day="7"

#
find $doc -type $datatype -mtime +$day -exec rm {} \;

#############


arrow
arrow
    全站熱搜
    創作者介紹
    創作者 Aminzai 的頭像
    Aminzai

    Amin's Note

    Aminzai 發表在 痞客邦 留言(0) 人氣()