資源描述:
《Linux常用操作》由會(huì)員上傳分享,免費(fèi)在線閱讀,更多相關(guān)內(nèi)容在教育資源-天天文庫(kù)。
1、1.設(shè)置ssh本地轉(zhuǎn)發(fā)ssh-L::例:在這里218.108.247.118為跳板機(jī),218.108.226.87為cms服務(wù)器在218.108.247.118上:$ssh-f-g-L7001:localhost:8080218.108.226.87?sleep7200?(-g參數(shù)可以讓7001這個(gè)端口可以被其它客戶端進(jìn)行轉(zhuǎn)發(fā),-f一旦SSH完成認(rèn)證并建立portforwarding,則轉(zhuǎn)入后臺(tái)運(yùn)行)這樣就可以在任何地方訪問cms了:h
2、ttp://218.108.247.118:7001/media/login/login.do2.設(shè)置ssh遠(yuǎn)程轉(zhuǎn)發(fā)ssh-R::例:在這里218.108.247.118為用戶可以訪問的服務(wù)器,218.108.226.87為cms服務(wù)器,但是在218.108.247.118上不能ssh到218.108.226.87,而218.108.226.87上可以ssh到218.108.247.118在218.108.226.87上:$ssh-R7
3、001:localhost:389218.108.247.118這樣就可以在任何地方訪問cms了:http://218.108.247.118:7001/media/login/login.do3.linux時(shí)間設(shè)置系統(tǒng)時(shí)間date-s'2011-10-1810:28:00'+'%F%T''''%Y??year%m??month(01..12)%d??dayofmonth(e.g,01)%H??hour(00..23)%M??minute(00..59)%S??second(00..60)%F??fulldate;sameas%Y
4、-%m-%d%D??date;sameas%m/%d/%y%s??secondssince1970-01-0100:00:00UTC'''時(shí)間計(jì)算8小時(shí)之后:date+'%F%T'-d"-8hoursago?2010-08-0810:10:10"?8小時(shí)之前:date+'%F%T'-d"8hoursago?2010-08-0810:10:10"?1970年以來的時(shí)間(s):date+'%s'??-d"2010-08-0810:10:10"?時(shí)間同步*/5****/usr/sbin/ntpdate218.108.255.205>/d
5、ev/null?2>&14.日志切割#cat/etc/logrotate.d/epg/opt/onewaveinc/epg/tomcat/logs/epg_catalina*.log{???????daily???????size1024M???????rotate5???????copytruncate???????missingok}#crontab-l*/6****/usr/sbin/logrotate/etc/logrotate.d/epg>/dev/null2>&1刪除1個(gè)月前的日志find/opt/onewaveinc
6、/epg/tomcat/logs/?-mtime+30?-execrm{};5.ftp自動(dòng)上傳下載腳本#!/bin/bashFtp(){?????lftp<7、Server:#/etc/init.d/nfsrestart#/etc/init.d/portmaprestart#mount-tiso9660?-oloop/oradata1/rhel-server-5.4-i386-dvd.iso??/media/cdrom#cat/etc/exports/media/cdrom?125.210.188.0/27(ro)???#主機(jī)和選項(xiàng)之間沒空格/mnt/san01?125.210.188.0/27(rw,sync,no_root_squash)/opt/oracle125.210.188.
8、0/27(rw,sync,root_squash,anonuid=501,anongid=502)'''root_squash默認(rèn)的,NFS會(huì)將UID或者GID為0的訪問用戶映射為服務(wù)端的anonymousno_root_squash不啟用root