一、记录一下如何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
原神祈愿模拟器最新版
原神祈愿模拟器手机版是一款完整汉化的趣味原神抽卡模拟小游戏,
宝宝森林美食完整版
宝宝森林美食游戏最新版是一款十分有趣的休闲益智游戏,帮助宝宝
g沙盒仇恨官方英文版(gorebox)
G沙盒仇恨英文原版是一款最近非常火热的沙盒模拟类游戏,在这里
迷你世界测试服最新版2024
迷你世界测试服2021最新版,即迷你世界的先遣服版本,用户能
闪耀暖暖最新版2024
闪耀暖暖手游这是非常好玩的换装手游,游戏内容丰富有趣,游戏环