压缩.log 文件为zip后删除原文件 需要注意:本人作为小白,该脚本需要和.log在一起,后面有时间需要改正. #!/usr/local/python/bin/python #-*-coding=utf8 -*- import time import os import sys import zipfile N = 7 #设置删除多少天前的文件 def zip(srcpath): for folder,sumfolder,files in os.walk(srcpath): for file
因为rm命令删除的文件是不会放入垃圾箱的,所以无法恢复,下面小编就给大家介绍一种方法,通过替换Linux rm命令的方法,从而将rm命令删除的文件放入垃圾箱. 方法: 1. 在/home/username/ 目录下新建一个目录,命名为:.trash 2. 在/home/username/tools/目录下,新建一个shell文件,命名为: remove.sh PARA_CNT=$# TRASH_DIR=“/home/username/.trash” for i in $*; do STAMP=`
参考 : http://www.lunar2013.com/2013/06/linux-%E8%AF%AF%E5%88%A0%E9%99%A4%E6%96%87%E4%BB%B6%E6%81%A2%E5%A4%8D.html Last login: Sun Jan 26 22:36:10 2014 from 10.10.10.5 root>/root#su - oracle oracle>/home/oracle$sqlplus / as sysdba SQL*Plus: Release 10