Ubuntu启用Crontab

启动cron服务:
service cron start
如果需要设置为开机时自动启动,则执行
sysv-rc-conf --level 35 cron on
另外,ubuntu默认没有开启cron执行的日志的,需要做如下3步:

  • 修改rsyslog文件,将/etc/rsyslog.d/50-default.conf 文件中的#cron.*前的#删掉
  • 重启rsyslog服务service rsyslog restart
  • 重启cron服务service cron restart

Ubuntu 14.04 + 版本的cron中使用notify-send

#!/bin/sh

eval "export $(egrep -z DBUS_SESSION_BUS_ADDRESS /proc/$(pgrep -u $LOGNAME gnome-session)/environ)"
notify-send $1

具体参见
然后编辑cron配置: crontab -e

0 * * * 1-5 sh /home/ronry/bin/cron-notice.sh 休息一下

相关文章:

  • 2022-02-21
  • 2022-12-23
  • 2021-11-30
  • 2022-01-21
  • 2022-02-27
  • 2021-11-01
猜你喜欢
  • 2021-09-28
  • 2022-12-23
  • 2022-01-13
  • 2021-05-15
  • 2022-12-23
  • 2022-03-03
  • 2021-06-02
相关资源
相似解决方案