2016年4月26日 星期二

Linux 文章

https://books.google.com.tw/books?id=vwGLFWIQ-Z8C&lpg=PA239&ots=aufeOHurV5&dq=crontab%20%E5%88%86%E8%99%9F&hl=zh-TW&pg=PA236#v=onepage&q=crontab%20%E5%88%86%E8%99%9F&f=false

2016年4月21日 星期四

yum 設定更新

# cat /etc/yum.conf
[main]
cachedir=/var/cache/yum/$basearch/$releasever
keepcache=0
debuglevel=2
logfile=/var/log/yum.log
exactarch=1
obsoletes=1
gpgcheck=1
plugins=1
installonly_limit=5
bugtracker_url=http://bugs.centos.org/set_project.php?project_id=16&ref=http://bugs.centos.org/bug_report_page.php?category=yum
distroverpkg=centos-release

#  This is the default, if you make this bigger yum won't see if the metadata
# is newer on the remote and so you'll "gain" the bandwidth of not having to
# download the new metadata and "pay" for it by yum not having correct
# information.
#  It is esp. important, to have correct metadata, for distributions like
# Fedora which don't keep old packages around. If you don't like this checking
# interupting your command line usage, it's much better to have something
# manually check the metadata once an hour (yum-updatesd will do this).
# metadata_expire=90m

# PUT YOUR REPOS HERE OR IN separate files named file.repo
# in /etc/yum.repos.d

# The proxy server - proxy server:port number
#proxy=http://zsphil53.intacc.local.csob.cz:8080
proxy=http://ahttpproxy:8080
# The account details for yum connections

2016年4月1日 星期五

NTP 校正時間

Linux

執行 /usr/sbin/ntpdate watch.stdtime.gov.tw
卻出現錯誤訊息"the NTP socket is in use, exiting "

必須先執行 :
 # service ntpd stop
# chkconfig ntpd off
再去執行

ntpdate clock.stdtime.gov.tw

或者直接修改

  • date MMDDhhmmYYYY 第一種設定 system time 的方法
  • date YYYY.MM.DD-hh:mm:ss 第二種設定 system time 的方法
hwclock -w 寫入到硬體