0 8 * /nmon/nmon.sh
0 0 * /home/oraprod/rman/d.sh 1>>/home/oraprod/rman/log/delbak.log 2>>/home/oraprod/rman/log/delbak.log
0 12 * /home/oraprod/rman/cp.sh 1>>/home/oraprod/rman/log/delbak.log 2>>/home/oraprod/rman/log/delbak.log
cat /home/oraprod/rman/d.sh
su - oraprod -c /home/oraprod/rman/del.sh >> /home/oraprod/rman/log/del$(date +%y)$(date +%m)$(expr $(date +%d) ).log
echo $(date +%y)$(date +%m)$(expr $(date +%d) ) >> /home/oraprod/rman/log/del$(date +%y)$(date +%m)$(expr $(date +%d) ).log
cat del.sh
find /mnt/nfs_hc/ -mtime +14 -name 'arc*' -exec rm {} \;
find /mnt/nfs_hc/ -mtime +14 -name 'bak*' -exec rm {} \;
find /mnt/nfs_hc/ -mtime +14 -name 'con*' -exec rm {} \;
find /nfs -mtime +7 -name 'arc*' -exec rm {} \;
find /nfs -mtime +7 -name 'bak*' -exec rm {} \;
find /nfs -mtime +7 -name 'con*' -exec rm {} \;
cat cp.sh
find 调用变量!
d=$(date +%Y)$(date +%m)$(date +%d)
name=$d
echo $name
find /nfs -name '$d' -exec cp {} /mnt/nfs_hc/ \;
find /nfs -name $name -exec cp {} /mnt/nfs_hc/ \;