0 7 * * * /bin/bash /opt/script/delete-old-folders.sh You will get an output like the one below. Apache Access log files are deleted older than 20 days +---+ Oct 11 /var/log/apache/2daygeek_access.11 Oct 12 /var/log/apache/2daygeek_...
# 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...
Warning:DO NOT blindly run this scripton your system. This script will delete files OLDER than 30 days from your/var/log/directory. This is for demonstration purpose only. You must change the location of the directory before running it. Here's an example script: In this example, the script...
给delete-old-files.sh设置可执行权限。 # chmod +x /opt/script/delete-old-files.sh 最后添加一个 自动化此任务。它于每天早上 7 点运行。 # crontab -e 0 7 * * * /bin/bash /opt/script/delete-old-folders.sh 你将看到类似下面的输出。 Apache Access log files are deleted older than 20 days...
find $INTRANETDESTINATION/daily -mtime +8 -exec rm {} \; # Delete weekly backups older than ...
Create one with touch ~/.zshrc and run the install script again. If you use bash, the previous default shell, your system may not have .bash_profile or .bashrc files where the command is set up. Create one of them with touch ~/.bash_profile or touch ~/.bashrc and run the install ...
Your script can now continue as before, to handle the case when an argument is present: mkdir$1 When you run this new version of the script, you’ll get a message if you forget to include an argument: 4. Delete a File Using a Bash Function ...
A bash script that uploads images & videos to IMGUR. It can also delete previously uploaded images/videos. - ram-on/imgurbash2
deleteKeywordAndPreviousNextLines "hello" 0 3 ./test.txt # 引申 # 若需删除匹配某字符串hello的行和匹配行的后2行,可以使用下面的脚本 sed -i '/hello/,+2d' ./test.txt 微风不燥,阳光正好,你就像风一样经过这里,愿你停留的片刻温暖舒心。
Version 3.7.2 2005/11/16 作者:Mendel Cooper mail:thegrendel@theriver.com 这本书假定你没有任何脚本或一般程序的编程知识,但是如果你有相关的知识,那么你将很容易 达到中高级的水平...all the while sneaking in little snippets of UNIX? wisdom and lor... ...