We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
版权声明:本文为 Bakumon 原创文章,转载需在明确位置注明出处!!!#11
notify-send 是 Linux 下发送通知到桌面的命令行程序。Ubuntu16.04 会在桌面右上角出现一个通知提醒框。
基本用法:
发送一条通知内容 notify-send "这是通知的内容"
notify-send "这是通知的内容"
发送一条有标题的通知 notify-send "标题" "这是通知的内容"
notify-send "标题" "这是通知的内容"
发送一条有图片的通知 notify-send /home/tip.png "标题" "这是通知的内容"
notify-send /home/tip.png "标题" "这是通知的内容"
crontab 是 Linux 下的定时任务,服务端一般用于定时重启某些服务、定时清理日志信息等。
sudo crontab -l
查看定时任务列表,如果有的话,将会列出来
sudo crontab -e
进入编辑 crontab 的模式下。
语法是这样的:
minute hour day month week command
例子:
每分钟都执行一次 command * * * * * command
* * * * * command
每小时的 2 和 3 分钟时执行一次 command 2,3 * * * * command
2,3 * * * * command
10 点到 18 点之间每个小时的 2 和 3 分钟都执行一次 command 2,3 10-18 * * * command
2,3 10-18 * * * command
晚上 11 点到早上 7 点之间,每隔 2 小时重启smb * 23-7/2 * * * /etc/init.d/smb restart
* 23-7/2 * * * /etc/init.d/smb restart
执行命令 sudo crontab -e 进入定时任务编辑模式,在最后一行加入以下代码:
0 */2 * * * export DISPLAY=:0.0; notify-send /home/tip.png "休息" "滚去休息吧!!!"
保存退出即可,偶数小时的 0 分钟就会有 “去休息” 的提示。
Note: 要在定时任务里调用图形界面程序,需要加上 export DISPLAY=:0.0; 环境变量,告诉定时任务图形界面程序显示的屏幕。
export DISPLAY=:0.0;
The text was updated successfully, but these errors were encountered:
No branches or pull requests
notify-send
notify-send 是 Linux 下发送通知到桌面的命令行程序。Ubuntu16.04 会在桌面右上角出现一个通知提醒框。
基本用法:
发送一条通知内容
notify-send "这是通知的内容"
发送一条有标题的通知
notify-send "标题" "这是通知的内容"
发送一条有图片的通知
notify-send /home/tip.png "标题" "这是通知的内容"
crontab
crontab 是 Linux 下的定时任务,服务端一般用于定时重启某些服务、定时清理日志信息等。
查看定时任务列表,如果有的话,将会列出来
进入编辑 crontab 的模式下。
语法是这样的:
minute hour day month week command
例子:
每分钟都执行一次 command
* * * * * command
每小时的 2 和 3 分钟时执行一次 command
2,3 * * * * command
10 点到 18 点之间每个小时的 2 和 3 分钟都执行一次 command
2,3 10-18 * * * command
晚上 11 点到早上 7 点之间,每隔 2 小时重启smb
* 23-7/2 * * * /etc/init.d/smb restart
结合出功能--每两个小时提示用户该休息啦
执行命令
sudo crontab -e
进入定时任务编辑模式,在最后一行加入以下代码:保存退出即可,偶数小时的 0 分钟就会有 “去休息” 的提示。
Note:
要在定时任务里调用图形界面程序,需要加上
export DISPLAY=:0.0;
环境变量,告诉定时任务图形界面程序显示的屏幕。The text was updated successfully, but these errors were encountered: