linux Autotest简介 linux at now
1.延时任务
at now+1min //1分钟后执行 at 15:00 //15:00执行 touch /mnt/file{1..3} //设置任务 ctrl+d //- at now+1min 字面意思等一分钟后再执行,其实为下一分钟的0秒执行;因为at命令是整分执行的
注:监控窗口中的时间为我截图时间,存在延迟;命令是按时执行的。
黑名单:
/etc/at.deny:默认存在,写入的用户将不能使用at命令
白名单:
/etc/at.allow:默认不存在,需要自己创建,用man 5 at.deny 查看得到的文件名,只有写入的用户才能使用at命令
注:root用户不受黑白名单限制;白名单和黑名单同时存在时,以白名单为准;如果创建白名单不写入任何用户,那么除root以外的所有用户将不能使用at命令,所以白名单慎用。
2.定时任务
systemctl status crond.server --开启才可执行定时任务
(1)crontab -e -u root回车输入任务,wq退出保存,时间到了便会执行
查看此文件正是刚才创建任务的内容,删除此文件,定时任务将取消(2)黑白名单与at命令相同:/etc/cron.deny | /etc/cron.allow
以黑名单为例:lee
su - lee:不可用crontab -e
crontab -e -u lee:可以使用,他是以root身份指定lee用户执行crontab -e
(3)系统任务:cd /etc/cron.d
命令方式:
文件方式:
* * * * * root run-parts /westos mkdir /westos cd /westos vim test.sh #!/bin/bash rm -fr /mnt/*3.定时清理
- 有时我们需要清理系统中的缓存,但又不能清理正在使用的,便可使用定时清理功能
- windows中我们需要手动清理垃圾;而linux中存在定时清理,无需手动清理垃圾
- /usr/lib/tmpfiles.d:指定系统中临时文件的相关信息(目录,周期等等);然后再由定时任务定期执行清理命令,便可达到定期清理。
创建两个生命周期为10s 的文件,执行清理命令,由于file1已经超过10s,会被清理;file2没有超过10s,依然保留
windows10 开启便签工具(Sticky Notes)桌面便签sticky notes
关于如何恢复Windows 10 便签(Sticky Notes)桌面便签sticky notes
解决:cannot execute binary filecannot execute binary file
Fix Git Remote Write Access to Repository Not Granted: Troubleshooting Guide for Developers
如何解决 Node.js 下载时的 could not retrieve https //nodejs.org/dist/latest/shasums256.txt 错误
How to Fix 'Failed to Register Fiddler as the System Proxy' Error: Step-by-Step Solutions
解决AttributeError: module 'matplotlib' has no attribute 'get_data_path'的有效方法