# chmod +x /opt/script/delete-old-files.sh 最后添加一个 cronjob 自动化此任务。它于每天早上 7 点运行。 # crontab -e 0 7 * * * /bin/bash /opt/script/delete-old-folders.sh 你将看到类似下面的输出。 Apache Access log files are deleted older than 20 days +---+ Oct 11 /var/log/a...
Old-Files-Deleteis run through a command line interface, so all of the command options are made available there. Here's the default response when runningold_files_delete.shwith no arguments: $ ./old_files_delete.sh | | A bash script to recursively delete files older than (n) days | 1....
aws_ecr_delete_old_tags.sh - deletes tags older than N days for a given ECR docker image. Lists the image:tags to be deleted and prompts for confirmation safety aws_emr_clusters_last_steps.sh - shows the last N steps executed on each EMR cluster and their EndTime to find idle cluster...
$>find/tmp-typef-mtime+30-execrm-rf{}+ While the above commands will delete files older than 30 days, as written, they fork thermcommand each time they find a file. This search can be written more efficiently by usingxargs: $>find/tmp-name'*.tmp'-execprintf'%s\0'{}\;|xargs-0rm...
有些爱学习的用户会去操弄linux软件程序,在操作linux的过程中,有时候要删除一个文件夹,往往会提示次...
SUBJECT="WARNING: Apache log files are deleted older than 15 days \$(date)" mail -s "\$SUBJECT" "\$TO" < \$MESSAGE rm \$MESSAGE /tmp/folder.out fi 给delete-old-folders.sh设置可执行权限。 # chmod +x /opt/script/delete-old-folders.sh ...
aws_ecr_delete_old_tags.sh - deletes tags older than N days for a given ECR docker image. Lists the image:tags to be deleted and prompts for confirmation safety aws_emr_clusters_last_steps.sh - shows the last N steps executed on each EMR cluster and their EndTime to find idle cluster...
ldapdelete(1) ldaplist(1) ldapmodify(1) ldapmodrdn(1) ldapsearch(1) ldd(1) lefty(1) less(1) lessecho(1) lesskey(1) let(1) lex(1) lftp(1) lftpget(1) lgrpinfo(1) libgd2(1) libnetcfg(1) libtool(1) libtoolize(1) limit(1) line(1) link(1g) links(1) list_devices(1) ...
# chmod +x /opt//delete-old-files.sh 最后添加一个 cronjob 自动化此任务。它于每天早上 7 点运行。 # crontab -e 0 7 * * * /bin/bash /opt//delete-old-folders.sh 你将看到类似下面的输出。 Apache Access log files are deleted older than 20 days +---+ Oct 11 /var/log/apache/2dayg...
How can I get all the files older than x months? and... How can I avoid that*.log.oldfile is included in the LIST attribute? #!/bin/shmin_date=$(date-d"$1months ago""+%Y%m%d")forlogin*.log.*;do["${log%.log.old}""!=""$log"] &&continue["${log%.*}.$min_date""<"...