一、记录一下如何ubuntu server如何查看crontab日志
crontab记录日志
修改rsyslog
sudo vim /etc/rsyslog.d/50-default.conf
cron.* /var/log/cron.log #将cron前面的注释符去掉
重启rsyslog
sudo service rsyslog restart
查看crontab日志
less /var/log/cron.log
二、ubuntu 重设crontab -e的默认编辑器
Ubuntu System Admin 在一线上服务器上设置计划任务, 不小心选择了nano, 由于以前接触的是redhat系列的, 不习惯用nano, 于是想重设下, 网上查了下, 貌似没有。。
无奈之下,重装一台服务器测试, 发现当你第一次crontab -e选择编辑器的时候就会提醒你: 以后若要该改变选择, 输入select-editor 唉,还是不够细心啊。。 sudo select-editor 选择vim 搞定。。
root@ubuntu:/var/www# select-editor
Select an editor. To change later, run 'select-editor'.
1. /bin/ed
2. /bin/nano <---- easiest
3. /usr/bin/vim.basic
4. /usr/bin/vim.tiny
选择的数字是“3”, /usr/bin/vim.basic。
三、ubuntu dash shell 改为 bash
ubuntu shell 下默认的脚本解析器是dash, 会使一些bash脚本执行失败.
通过如下方式改回bash:
sudo dpkg-reconfigure dash
选择NO
四、如何修改resolv.conf
unbuntu每次重启会重置resolv.conf
1.把/etc/network/interfaces文件里的dns-nameservers写入resolv.conf
2.把/etc/resolvconf/resolv.conf.d/base的内容复制到resolv.conf
因此我们要保证每次重启后resolv.conf不变的话我们就要从如上两个文件着手修改
五、如何修改IP
修改如下配置文件即可
cat /etc/network/interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
auto eth0
iface eth0 inet static
address 192.168.1.100
netmask 255.255.0.0
network 192.168.0.0
broadcast 192.168.255.255
gateway 192.168.1.1
# dns-* options are implemented by the resolvconf package, if installed
dns-nameservers 192.168.0.1
六、修改主机名
修改如下两个文件即可
/etc/hostname
/etc/hosts
ubuntu,FAQ
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
更新日志
- 群星2013-青春缤纷辑压箱宝大公开3CD2[新加坡限量版][WAV整轨]
- 林育群.2013-BalladShow(日本版)【环球】【WAV+CUE】
- 陈加洛.1992-痛到感觉不到【宝丽金】【WAV+CUE】
- 群星.2023-宿命之敌电视剧原声带【韶愔音乐】【FLAC分轨】
- 東京事変-大発見[FLAC+CUE]
- 椎名林檎-三文ゴシップ[FLAC+CUE]
- 2024年08月04日
- 裘德《裘德「最后的水族馆」演唱会LIVE》[320K/MP3][228.89MB]
- 裘德《裘德「最后的水族馆」演唱会LIVE》[24bit 48kHz][FLAC/分轨][2.08G]
- 基因三重奏《如果你什么都不说 音乐会现场录音》[320K/MP3][145.37MB]
- 孟庭苇.1996-月亮说话(2020环球24KGOLD限量版)【上华】【WAV+CUE】
- 群星.1997-新艺宝优质音响系列·国语精选监听版【新艺宝】【WAV+CUE】
- 阿桑.2005-寂寞在唱歌(星外星引进版)【华研国际】【WAV+CUE】
- 基因三重奏《如果你什么都不说 音乐会现场录音》[FLAC/分轨][287.43MB]
- 蔡题谦《我爱你,却依然要看你走》[320K/MP3][88.65MB]